Chadori's Recent Forum Activity

  • I ran it again and it's doing fine. I added End of Layout > Destroy Background to each level.

    The background is high resolution (the only high-res graphic.) that may have been what was causing it.

    In the debugger, I noticed that even when timescale was set to 0, it was still doing collision checks. Sprites on future levels don't move until the layout begins, correct? If the Sprite is set to 0, until the code making it move runs (when the layout is active) it stays still?

    Unless Sprites are loaded and moving in Layouts that are not. Sprites are supposed to move, but the Layouts where they're moving are not active yet. As in, when the Layout is active, they move. What i'm getting is that Sprites are not loaded until the Layout is loaded. Meaning they should not be moving.

    Because when the Layout loads, the Sprites are where I placed them in the Layout view. Which means they are not moving when the layout is not active. Yet the debugger shows collision checks.

    If the Sprites on inacvtive, future, layouts are not moving, how can there be collision checks when timescale = 0

    Im concerned about this because I don't want to melt the phones of people who get this game. Better to solve it now, then end up wrecking peoples' phones.

    Good thing that you fixed it. I am curious, what is the imagesize of your background? Is it a whole sprite? Just for future reference.

  • Phoenixbowman - Okay I understand. Can you show us a .capx file because guessing will be the only thing we can do without much information.

  • There ought to be a function that checks to see if Sprites are used on the next layout. If they are, then there should be the option to flush them from memory. That way, they're not piling up.

    Uhhm. Yes and No.

    Actually, Construct 2 adds and flushes images based on what you put inside the layout.

    For example: If I add an image of "Player1" in "Layout1" but did not add it in "Layout2" then If I go from "Layout1" and go to "Layout2" then the memory will flush "Player1" when I go to "Layout2". That is because Construct 2 only preloads or adds images from what Construct 2 sees inside the layout. Thats why if we have an event that will create objects, we need to make sure that the images of the objects are all added in the layout

  • Were your sprites "Global - Yes" ?

  • >

    > > Something is causing memory to keep increasing. The memory goes up and up. If objects were being flushed than memory would drop. Something is still running in previous layouts. I re-use Sprites from previous layouts.

    > >

    > > Do Sprites that are used later persist in memory from previous layouts?

    > >

    >

    > In my past experiments. There are some cases.

    >

    > If the sprites from your old layout is present in your new layout then it won't be flushed but if it isn't present in the next layout then it will be flushed.

    >

    The Sprites from the old layout are present in the new layout.

    Thank you for this information. That could explain what is going on.

    Will doing at End of Layout > Destroy A destroy the sprite and flush it from memory?

    On End of Layout > Destroy A

    Destroy B

    Destroy C

    A B C and are on the current layout. Will that function destroy A B and C, even if they are present on the next layout?

    I think you misunderstood something Phoenixbowman .

    The images of the sprite are the only thing stored in the memory not the sprites or objects nor instances. The instances you are talking about (The Objects on the layout, THE number of sprites) are codes that are generated by the things you put in the layout or you created using the eventsheet.

    IE: 100 instances of 1 sprite of 32x32 image

    (100 instances are code during layout and not persisted on next layout in other words they are only available in that layout and is cpu based not memory.)

    (1 sprite of 32x32 image is stored in the memory)

    Explanation:

    1 image of 32x32 image or frame is stored in the memory and the cpu is used to make them 100 instances and do movements.

  • Something is causing memory to keep increasing. The memory goes up and up. If objects were being flushed than memory would drop. Something is still running in previous layouts. I re-use Sprites from previous layouts.

    Do Sprites that are used later persist in memory from previous layouts?

    In my past experiments. There are some cases.

    If the sprites from your old layout is present in your new layout then it won't be flushed but if it isn't present in the next layout then it will be flushed.

    If the sprites are global then it will never be flushed.

    -------------------------------------------------------------

    //*Persistent Sprites - Don't be fooled of the word, the image is not stored in the memory. The information that it exists is stored in the storage of the device if I am correct.*//

    If the sprites are persistent then the information that it exists is stored in the storage of the device(Not MEMORY).

    So the memory management is still the same above but better optimized because the if the image is not preloaded in the layout but when you are back in the layout

    it automatically preloads itself. But on initial creation, it should be preloaded by adding the object in the layout on startup and destroyed if not needed.

  • How do I make a Low Quality, Medium Quality and High Quality option in a game? It is to enable support for non-HD Phones on GooglePlay. If it is possible, will it have significant improvement in games? My Game has a window scale of 16:9 (1280px720p) and I want to reduce the quality or scale size for performance for lower specs phones.

    Thanks XD in advance.

  • Phoenixbowman Don't be stressed about it. Construct 2 is smart enough to flush out memory of images from past layout to make room for another layout.

    Please read if you have time : (These are helpful and this is from the founder of Construct 2 "Ashley")

    https://www.scirra.com/tutorials/298/pe ... bile-games

    https://www.scirra.com/blog/83/optimisa ... -your-time

    https://www.scirra.com/manual/134/performance-tips

  • Back when there were 10 Layouts, it was not a problem. Something is persisting. I read online that Assets that are used later on are stored in memory.

    Is there anyway around this? It looks like Assets on the previous layouts are staying in memory. thus the more layouts go by, the more memory goes up.

    WIll At End of Layout Destroy Object remove these from memory?

    On End of Layout > Destroy A Destroy B Destroy C

    Will that remove them from memory?

    based on Ashley said:

    https://www.scirra.com/manual/134/performance-tips

    Not placing all used objects in the layout

    If objects are not placed in a layout but are created by events, Construct 2 will load the textures for those objects the moment you create them. This can cause a momentary pause or "jank" and make the game feel less responsive. This can be avoided by placing any used objects in the layout.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Based on Ashley said, Objects are only preloaded by layout change so nothing to worry about clearing memory when leaving a layout (Exemption for Global Objects). Your memory problems is caused by something else. If I am to guess, the cause must be unseen events that cause looped object creation or too many objects on layout. Try to debug using Construct 2 debugger.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Still though. I think Scirra Manual contents about Admob (https://www.scirra.com/manual/184/admob) should be updated with a working Plugin ID. Game Dev's might get confused about that unworking plugin id and as a result, people might think twice of using Construct 2 for android or even give up. Construct 2 team can fix big issues with no problem but please don't forget about the little things that makes this program amazing like the scirra manual.

  • Thanks Kyatric ! You are a time saver XD .I wouldn't have found this link by myself. I will try it.

Chadori's avatar

Chadori

Member since 10 Oct, 2014

Twitter
Chadori has 50 followers

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

24/44
How to earn trophies