How do I use huge images without making the game lag

Get help using Construct 2

Post » Mon Dec 21, 2015 3:23 pm

So I'm making the game where you basically climb up through platforms and the higher you go the darker it gets. Once the player goes to space I could make it completely dark and use small images, but I really want the starting look really nice and to do so I need to use huge sizes like 9000x3000 which makes the game lag. Any tips ?

Image
B
5
S
1
Posts: 21
Reputation: 377

Post » Mon Dec 21, 2015 4:06 pm

deropke2 wrote:So I'm making the game where you basically climb up through platforms and the higher you go the darker it gets. Once the player goes to space I could make it completely dark and use small images, but I really want the starting look really nice and to do so I need to use huge sizes like 9000x3000 which makes the game lag. Any tips ?


Considering an image that size would use up approx. 108MB RAM I'd suggest not using something that size. Also, few GPUs would be able to render such a texture size.

Have you tried splitting it up into smaller chunks?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
73
Posts: 5,086
Reputation: 51,992

Post » Mon Dec 21, 2015 4:58 pm

Considering an image that size would use up approx. 108MB RAM I'd suggest not using something that size. Also, few GPUs would be able to render such a texture size.

Have you tried splitting it up into smaller chunks?


The file size is like 2mb and yeah I considered doing that, but it would take me so much time and I don't even know if that would help
B
5
S
1
Posts: 21
Reputation: 377

Post » Mon Dec 21, 2015 6:29 pm

Hey @deropke2 hi.

Yes you can!
By the way it is really simple even with more complex images than this one.
3-5 minutes in construct 2 editor.
http://www.filedropper.com/smallimage
I think you get the idea.

Cheers.
B
36
S
15
G
1
Posts: 59
Reputation: 3,441

Post » Mon Dec 21, 2015 6:30 pm

deropke2 wrote:
Considering an image that size would use up approx. 108MB RAM I'd suggest not using something that size. Also, few GPUs would be able to render such a texture size.

Have you tried splitting it up into smaller chunks?


The file size is like 2mb and yeah I considered doing that, but it would take me so much time and I don't even know if that would help


File size has nothing to do with memory size..
In memory the image is unpacked..
9000x3000x4= 108000000 bytes = 108MB would be the memory size if not placed on a power of 2 texture (which sometimes happens), in which case it would be bigger 16384x16384x4 = 1074MB..

Sounds like a really bad idea to me..

Making a much smaller sprite with a gradient and just stretching it should work just as good..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 21, 2015 7:10 pm

The information on filesizes and memory use has been extensively written about by Ashley in numerous posts and blogs. It takes very little effort to find them.

A useful start would be THIS blog from Ashley.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
73
Posts: 5,086
Reputation: 51,992

Post » Mon Dec 21, 2015 7:15 pm

Making a much smaller sprite with a gradient and just stretching it should work just as good..


This is a good idea, I'm going to try it
B
5
S
1
Posts: 21
Reputation: 377


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u, jhjconstruct, tarek2 and 8 guests