Sprite Sheets

Discussion and feedback on Construct 2

Post » Fri Aug 26, 2011 4:26 am

[QUOTE=PoseMotion] [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.[/QUOTE]

I see what you're both trying to say here. I think it's a common mistake to try to move an object using animations, and it most often wont work. But if you have, say, a little power up that orbits around your character yet is purely an effect (it doesn't shoot or shield damage or anything), then it's better to move it via animations, for instance:

the little balls rotating around robotnik (dr. eggman for some of you) are best implemented as animations, not as actually changing positions via code.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Aug 26, 2011 5:00 am

Yes Fimbul, there are certain situations that you can't avoid. Which is fine.

But lets say you have a character who jumps, spins, and then lands. I would not animate his spin in a sheet. That would give you approximately 9 to 14 more images then needed. Just create one image of the character rolled up. Then when it's time for him to spin, clip that frame and do it by code. You just save your sprite sheet from being larger then needed. And also achieved a better frame rate of your spin. Instead of only getting maybe 10 fps on the spin.

As for an actor with a large sword. Let's say you create his right arm in its own sprite sheet with sword. And the character in it's own sprite sheet. You just saved your self a bunch of dead space in your single sprite sheet and you have more animating and rotation options with the arm and sword sheet.

Anyway, just trying to help. Not trying to start anything here. ;)
B
18
S
5
G
2
Posts: 16
Reputation: 2,012

Post » Fri Aug 26, 2011 5:09 am

I'm not sure I agree with your Robotnik example. Each additional frame would add the same amount of vram as the first, and be static. Not to mention the issues of collision detection, and deltatime.
Where in code you would only use vram equal to the first frame, and be able to do much better collision detection with randomization, etc.
On the other hand the code method is moot at this point, as there is no z currently.newt2011-08-26 05:10:21
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Aug 26, 2011 12:44 pm

[QUOTE=PoseMotion]Anyway, just trying to help. Not trying to start anything here. ;)[/QUOTE]
Oh, certainly. I understood what you said. A common situation is when people try to implement that delay on a missile between you firing it and it actually starting its engines via animations, resulting in glitchy collision/hit detection and memory waste. Character jumps via animations are glitchy just as bad.
I used the example to show there are a couple rare situations that you CAN use animations
[QUOTE=newt]I'm not sure I agree with your Robotnik example. Each additional frame would add the same amount of vram as the first, and be static. Not to mention the issues of collision detection, and deltatime.[/QUOTE]
Sure, but you can see where I'm getting at. Maybe in your game, you have little balls floating around you for each 1 extra life that you have, or maybe your fairy companion (that does nothing) rotates around you. You get my point. The situations where it's ok to do movement via animations are very limited, but they do exist.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Aug 26, 2011 1:06 pm

Maybe it's one of those situations where there are pros and cons either way, and you just have to decide what's right for you! :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Fri Aug 26, 2011 1:45 pm

[QUOTE=Fimbul]
Sure, but you can see where I'm getting at. Maybe in your game, you have little balls floating around you for each 1 extra life that you have, or maybe your fairy companion (that does nothing) rotates around you. You get my point. The situations where it's ok to do movement via animations are very limited, but they do exist.[/QUOTE]

Sure, for example morphing, or warping as its sometimes called, but there are tools in the works.....
Evil laugh
muhahaaahaaaa
Pokes Lucid
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Aug 27, 2011 3:14 am

Maybe when cropped sprite sheets are supported, you'll all see what I am up to! (*nudge nudge Ashley*)
B
4
G
1
Posts: 5
Reputation: 635

Post » Sat Aug 27, 2011 5:00 am

[QUOTE=Ashley] Maybe it's one of those situations where there are pros and cons either way, and you just have to decide what's right for you! :)[/QUOTE] Sure, there's pro and cons for either way. But it's best to decide what is the best for the cpu and memory. If that means more work on the developing end, so be it. There's nothing worse then purchasing or even playing a free game just to find out it could have been optimized better.
B
18
S
5
G
2
Posts: 16
Reputation: 2,012

Post » Sat Aug 27, 2011 7:00 pm

[QUOTE=PoseMotion]There's nothing worse then purchasing or even playing a free game just to find out it could have been optimized better. [/QUOTE]

You're right, people would be upset they didn't pay for it

Seriously though, every game can be optimized better, especially the ones you've paid for. They figure "Well, we could waste a weeks worth of budget to make it run on lower end machines, or we can encourage/force people to upgrade to newer hardware, at no cost to ourselves."

Although someone making free games may not be paid for it, they would also lose valuable time making minor improvements most users won't notice.Jayjay2011-08-27 19:03:18
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat Aug 27, 2011 7:55 pm

To be honest I don't actually see much efficiency advantage over using sprite sheets. C2 can PNGCrush files to absolutely minimise the PNG filesize, and modern graphics cards can use non-power-of-two textures so split frames don't use more VRAM than a single sprite sheet, as well as being able to render 2D things so fast that there's nothing to be gained by rendering from one texture instead of many. So what other efficiency gains are you looking for by using sprite sheets?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: BackendFreak, tayxd and 13 guests