multilevel game - memory issue

  • I am making multilevel game .The backgrounds , which I am using in my game is size of 2048*1536 .

    Some level have common backgrounds. So, I just copy background object from one layout to another layout. This doesn't affect on game size.

    But it lead to increase the memory usage. Whenever I copy such backgrounds It increased the memory usage. and the increase is about 7 MB.

    My game Size is 13 MB. But memory usage is 67 MB.

    How to reduce memory usage? due to large background this happens? or something else?

    <img src="smileys/smiley5.gif" border="0" align="middle" />

  • I am making multilevel game .The backgrounds , which I am using in my game is size of 2048*1536 .

    Some level have common backgrounds. So, I just copy background object from one layout to another layout. This doesn't affect on game size.

    But it lead to increase the memory usage. Whenever I copy such backgrounds It increased the memory usage. and the increase is about 7 MB.

    My game Size is 13 MB. But memory usage is 67 MB.

    How to reduce memory usage? due to large background this happens? or something else?

    <img src="smileys/smiley5.gif" border="0" align="middle" />

    I can't be sure at 100%, but a browser having to render such big images may have problems, maybe if you cut them into different tiles (aka: images).

    PS:Why are you displaying so High Quality images?

  • I have to support all screen size iphone to ipad, Samsung galaxy s4 to desktop pc.

    so,I kept this.

    Tiles property repeats the pattern. But My background is little bit natural scene type. So it cant be tiled. <img src="smileys/smiley18.gif" border="0" align="middle" />

  • I have to support all screen size iphone to ipad, Samsung galaxy s4 to desktop pc.

    so,I kept this.

    Tiles property repeats the pattern. But My background is little bit natural scene type. So it cant be tiled. <img src="smileys/smiley18.gif" border="0" align="middle" />

    When I said "tiled", I suggested you don't display One big Image, but you cut it multiple times and place them, like a complete puzzle, so the display will not be different, but the browser will have to support multiples medium sizes images instead of one Big picture, not sure it will work though

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I was struggling with the same issue for mobile. I was thinking of loading the background dynamically, and storing a ton of sizes and aspect rations on the server as images. If there is not an exact fit, I would either get a larger one and crop or scale down, or smaller and up.

    However, what I found was that although my game only displayed a few sprites at a time, there were so many outside the game (as you need to have sprites for every thing which can be touched or moved). The core game was fast, but when I added all the dumb info screens and their backgrounds, buttons, settings and all the stuff you need to put round the game, it was too slow and the code unattainable so abandoned the project even though the games themselves were complete (it was a suite of slot machines for real money for an existing online casino).

    However, I'm keeping my eye on construct 2's progress, hoping that one day it will have more support for native html 5 mobile, e.g. the ability to swipe in a settings form and a better solution for multiple screen sizes/ratios without black letterbox bars (which is currently possible, but extremely difficult when you add swipe navigation). When It does, the world we be at our feet.

  • Is there any solution to reduce memory usage??

    And increase in memory is due to large backgrounds??

  • Another good idea is if you use multiple times the same background to make it global and spawn it just in the "On Start of Layout" event ;) This helped me much at my "diablo" like game

  • See Kyatric's link. It's almost impossible to design efficient using large tiles like that.

  • Having you thought of releasing an iPad specific version, a PC specific version and so on? You don't need just one file.

  • You can also take the generic portions of you background like the sky, etc... and make that a separate tiled background. And then take the smaller detail pieces and make them into smaller tiles/sprites. Unless there is no portion of your background that repeats the same type of texture.. sky, water, mountains, jungle, etc... would all be workable as tiled backgrounds, then layer the more detailed items on top.

  • thanks <img src="smileys/smiley1.gif" border="0" align="middle" />

    After reading that article I could reduce space from 67 Mb to 26.5 Mb. <img src="smileys/smiley2.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)