Video vs. PNG image sequence performance

Discussion and feedback on Construct 2

Post » Tue Jun 24, 2014 7:41 pm

Hi. Been testing out the new video feature, and it's completely godsent! I also see that it doesn't consume nearly as much memory as I first feared. So I have a question I would love for someone tech-savy to answer for me.

Currently my game uses a lot of rectangle shaped assets which are fully animated with 8 frames of 512x512. This consumes a lot of memory and spritesheets, but I see potential in turning these animated assets into video to save memory and load times. Has there been any testing on how many video files running at the same time can effect performance, or if it's even practical at all?

I would appreciate it if anyone has any insight on the matter.

Thanks
Tom
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Tue Jun 24, 2014 8:21 pm

I can't imagine you could have too many. video is similar to music streaming.

Slice of data is read.
Slice is unpacked <===== CPU HOG
slice is rendered
slice is destroyed

on pc you could probably get a way with a good handful. Maybe even many primary objects. However on mobile this technique would probably die and cause the device to burn in glory.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Tue Jun 24, 2014 8:35 pm

I see. Haha yeah mobile isn't a target platform for the game. Any potential mobile device version will have way downscaled ambitions.

So you're saying video is mostly CPU intensive?

Thanks for the insight.
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Tue Jun 24, 2014 9:00 pm

Lots of browsers already have GPU-accelerated video decoding.

I think 8 frames isn't enough for much benefit for video - the memory usage may or may not be lower, but 8 frames of video is likely to have a significant quality impact, since it will probably just have one keyframe then seven delta frames. Video is also designed for long-running media and it may end up just decoding everything fully in to memory anyway if it's short. It could be worth experimenting with though.

Note your spritesheets will be a lot more space efficient if you use just under a power-of-two size, e.g. 500x500, since spritesheets are power-of-two plus an extra pixel transparent border round each image. So you can only fit 3 tiles of 512x512 across a 2048x2048 spritesheet, not 4.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Tue Jun 24, 2014 9:19 pm

I see. What exactly is the complete optimized spritesheet sizes for taking advantage of the most space possible? Most assets are currently 128x128, should I just downscale it to 120x120, 124x124, 127x127? Also for the 500 mark, is it 500x500, 508x508 or 511x511 per asset?

Thanks again!
B
32
S
10
Posts: 370
Reputation: 3,156

Post » Wed Jun 25, 2014 1:01 pm

The maximum spritesheet size is 2048x2048, but if it can fit on a smaller power of two size (1024x1024, 512x512 etc) then it will. Since every image gets a 1px transparent border added around it, the most efficient size is two pixels smaller than a power-of-two size. For example 126x126 will have a border added bringing it up to 128x128, and then that can fit perfectly on any size spritesheet (2 across on 512x512, 4 across on 1024x1024, 8 across on 2048x2048).
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Wed Jun 25, 2014 2:29 pm

Personally I think the OP should try this out. I'm sure this could work great to an extent. It's just that I think this would be best used for high frame count objects, that are few and far between. CPU/GPU acceleration. In either even there is a reason why the industry doesn't use video's as the primary form of animation.

As an example. This could work well for animated backgrounds. Interactable characters in adventure games. Monsters in Final Fantasy combat.

However I don't think these would work well in games where it's used for the player in a platformer. I think the buffering for the video would causes visual latency.

Also here is a question. What about transparency? Can video's have transparency?
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Wed Jun 25, 2014 4:34 pm

jayderyu wrote:Personally I think the OP should try this out. I'm sure this could work great to an extent. It's just that I think this would be best used for high frame count objects, that are few and far between. CPU/GPU acceleration. In either even there is a reason why the industry doesn't use video's as the primary form of animation.

As an example. This could work well for animated backgrounds. Interactable characters in adventure games. Monsters in Final Fantasy combat.

However I don't think these would work well in games where it's used for the player in a platformer. I think the buffering for the video would causes visual latency.

Also here is a question. What about transparency? Can video's have transparency?



I am pretty sure that videos can not have transparency once rendered.
B
4
Posts: 2
Reputation: 206

Post » Wed Jun 25, 2014 5:07 pm

Then you are pretty wrong.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Wed Jun 25, 2014 7:04 pm

B
97
S
35
G
29
Posts: 3,139
Reputation: 28,371

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 34 guests