Von Perkele's Recent Forum Activity

  • Hi,

    You might have read that 50 - 60 mb recommendation from an older post. These days most hand held devices have at least 1 gb of ram, computers and newer phones certainly have much more.

    You can decrease your memory usage mostly by trying to limit the size and number of different objects. Try to use many smaller sprites rather than a few big ones and try to use duplicates of sprites when possible.

  • Aah ok. That means it might indeed be irrelevant whether you use multiple clones of same images and sprite fonts or whether you try to limit the number of objects by avoiding cloning.

  • Yes, duplicate objects will use more memory. This at least is true for Construct 2, in Construct 3 you can choose to "deduplicate images".

    What do you mean by deduplicate images? I use Construct 3.

  • But if you have two different objects that is double the memory usage, correct? But if you have two instances of the same object, only one object is loaded and you save memory.

  • Or should you try to use different instances of the same sprite font object? It's easier to just clone the same sprite font, but if there are hundreds of different texts you need to set up do you think it will start to use too much memory?

  • Thanks!

    I think I got to work the way I want now.

  • Yes, I see how that should work. However, I think I'm setting up the code incorrectly since I don't seem to be able to pin the child object to the parent object. How would set up the event to pin each child to their parent object after creation.

  • This is how i tried to pin the "parent" and "child" instance together:

    Upon creation two instances are given the same Family.UID variable value. The other instance is also set Child Boolean True.

    Object.FamilyUID = Family.FamilyUID

    Obect = Child Boolean True

    => Pin Object to Family.

    Doesn't seem to work.

  • In this case I have about 120 objects that are constantly moving, so their Z-level needs to be updated quite frequently. I suppose that can start to get demanding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi DOP!

    I Know I should Use families. There is on complicating factor though. I would like the instances to be on separate layers for effect purposes. However, I'm also sorting the z-order of the instanced by using the "sort z-order" action which seems to move all the instances of the same object to the same layer.

    So I'm not sure if what I'm trying to do is really possible, unless you can use the "sort z-order" action selectively, so instances of the same object get sorted right on different layers. Alternative methods of sorting z-order are probably more resource demanding than just using two objects.

  • If you want to have two sprites of same size and shape over each other (to create certain visual effects by manipulating their effects individually for example) does it make more sense to use two different objects or try to use two instances of the same object and control them individually by manipulating their instance variables individually.

    Using two objects is much easier since you can just pin one to the other, but using two instances of the same object would save memory usage if you are using large sprites and you would be using the same sprite for both objects anyway.

    I tried using two instance of the same object but could not get it to work really well. How would you code an object so it always has two instances on top of each other and you can control the variables of those two overlapping instances individually?

  • Be careful with "Trigger once", it's the most misused feature in Construct and it can cause lots of problems when used incorrectly. Don't use this condition by its own, with loops, inside of functions, triggers, with conditions that can pick multiple instances etc.

    > what's the difference between using "PickedCount = 0" and using "Else"

    When nothing is picked in event #3 in my screenshot, you will not be able to check "Sprite.PickedCount=0". If you add any sub-events or actions inside this event, they will not be executed.

    That's all very good to know.

    Does that mean "PickedCount = 0" is always useless and you should always use "Else" instead?

Von Perkele's avatar

Von Perkele

Member since 26 Mar, 2020

None one is following Von Perkele yet!

Trophy Case

  • 4-Year Club
  • Email Verified

Progress

5/44
How to earn trophies