How do I use very large background

Get help using Construct 2

Post » Tue Jun 23, 2015 1:59 pm

Hi,
Construct 2 is telling me my game is going to be using a lot of memory because I have a large background. The background is currently 10000x10000 as it is a Google Maps image of the centre of Manchester with a high zoom in. The problem is I actually intend to make this as big as 100000x100000 to cover the area needed. How can I make it so memory on devices is not being over used? I thought using the Google Maps plugin may be a good idea but users were given the ability to move the map rather than it being static and also it overlapped all of the sprites.
Thanks
Jacob
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Tue Jun 23, 2015 2:18 pm

Just some math:

10000x10000x4 = 400.000.000 bytes = 400MB of image memory needed for just that one sprite..

I would advise against it..
Strongly..
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 » Tue Jun 23, 2015 3:05 pm

What would you suggest to work around this? At the moment Google Maps seems the best way however the plugin available will only go in front of the sprites.
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Tue Jun 23, 2015 3:12 pm

Windows is telling me my sprite is only 5MB, so I may just continue with the current method if their isn't a work around and split the background into different sprites so it is contained in 1000px x 1000px blocks
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Tue Jun 23, 2015 3:22 pm

Windows is telling you how?
You mean the size the sprite is "on disk" as opposed to unwrapped in your image memory?

No matter how well your image is packed (as png or jpg) while playing the game it will take 400MB of image memory..
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 » Tue Jun 23, 2015 3:33 pm

Do as google does, slice it up in parts.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Tue Jun 23, 2015 3:50 pm

lennaert wrote:Do as google does, slice it up in parts.


Which will only help if you dynamically load and unload them from memory, right?
Which construct 2 doesn't do as far as I know..
All images on a layout are loaded into memory at start of layout..

https://www.scirra.com/blog/112/remembe ... our-memory
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 » Tue Jun 23, 2015 4:07 pm

why power of 2 is better for background or tiled background ?

example ? please
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Tue Jun 23, 2015 4:22 pm

matrixreal wrote:why power of 2 is better for background or tiled background ?

example ? please


From the Manual
Which you can visit with the link at the top of this page, by the way..

Power-of-two sizes

For best results, use a power-of-two sized square image for the Tiled Background (e.g. 16x16, 32x32, 64x64, 128x128...). This achieves best results in WebGL mode. The object will still work correctly with non power-of-two sized images, but the quality may be slightly reduced since the image has to be stretched to a power-of-two size before tiling. (Note this does not apply to Sprite objects, which can use any size.)
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 » Tue Jun 23, 2015 4:41 pm

viewtopic.php?t=74837&start=0
No idea if it still works.
Image ImageImage
B
168
S
50
G
169
Posts: 8,283
Reputation: 108,195

Next

Return to How do I....?

Who is online

Users browsing this forum: DharmaOne and 19 guests