Help me make my App run better ?

JamieOneilJamieOneil Member Posts: 877
edited November -1 in Working with GS (Mac)
Okay so here is the basic's of what happens.
You tap somewhere to spawn an actor then you drag it somewhere.
You are trying to make steps with the actors to get away from something.

but after a while there could be up-to 100 actors on the scene.
I was wondering if there is anything i could do that would make it run better later in the app ?

Thanks.

JamieOneil

Comments

  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    Dont Spawn Actors, Recycle Them.
    If you can, Unckech movable Option in actors, and Move them with Interpolate.

    Watch Cookbook Videos for more details.

    Cheers.
  • JamieOneilJamieOneil Member Posts: 877
    MagoNicolas said:
    Dont Spawn Actors, Recycle Them.
    If you can, Unckech movable Option in actors, and Move them with Interpolate.

    Watch Cookbook Videos for more details.

    Cheers.

    Thats the hard thing.
    I can't recycle.
    Because the actors are making steps and there is gravity on them, if i have them change position then the steps will fall. ?
  • JamieOneilJamieOneil Member Posts: 877
    Anyone ?
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    When you say you have "gravity on them", do you mean you are using the gravity attribute? If so, you can turn off the gravity attribute and just put an accelerate behavior on each actor you want affected by gravity to simulate the effect. Then you'll have more control over things (like being able to recycle actors).

    In my experience, if you have a lot of rules in a lot of actors, it can affect performance too. If you're spawning actors and not seeing them again after they have gone off-screen, make sure you destroy them.
  • JamieOneilJamieOneil Member Posts: 877
    JeffreyShimane said:
    When you say you have "gravity on them", do you mean you are using the gravity attribute? If so, you can turn off the gravity attribute and just put an accelerate behavior on each actor you want affected by gravity to simulate the effect. Then you'll have more control over things (like being able to recycle actors).

    In my experience, if you have a lot of rules in a lot of actors, it can affect performance too. If you're spawning actors and not seeing them again after they have gone off-screen, make sure you destroy them.

    Look at my post above, I CAN'T recycle, in my app, you make steps, if I have the steps destroy then people wouldn't be able to play the game?

    I need another way than recycle
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    As a matter of fact, I have read your post several times. You did not write if the player can go up AND down the steps (vs. a constant climbing up game like Doodle Jump). If the player can only go up (with the steps already used going off-screen), then you could use recycling. Since you did NOT provide this information, how are we supposed to know how your game works and what workarounds there are? You're the only one here that's seen your game. We can only go by what you wrote.

    - Jeff
  • calvin9403calvin9403 Member Posts: 3,186
    @JamieOneil
    make a video why you can't recycle your actors
  • JamieOneilJamieOneil Member Posts: 877
    You don't need a video.

    If i have the actor destroy when it goes out the screen then the steps will fall because the bottom step will be gone.....
  • JamieOneilJamieOneil Member Posts: 877
    Okay i really would like help so here is a video. I think you get the idea now ? :)
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    Ok, You Can`t Recycle, But you can Have the Steps on Screen From the beginning (Hidden Off Screen), that way you would not spawn actors, because Spawn use a lot of resources.

    Cheers.
  • JamieOneilJamieOneil Member Posts: 877
    MagoNicolas said:
    Ok, You Can`t Recycle, But you can Have the Steps on Screen From the beginning (Hidden Off Screen), that way you would not spawn actors, because Spawn use a lot of resources.

    Cheers.

    I was thinking that.
    But i would need help.
    If there are about 20 off the screen, when you tap to move it to your touch position, won't it just move them all ? when i only want it to move one ?
    Thanks

    JamieOneil
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    You Must have an Attribute like: Wich One Draging
    And every time you drag one Stpe, you add a + 1 to it.

    Then you have every step with a number.
    And if the Wich one Draging is equal to one Step number, then you move that one.

    Hope I Explain myself.

    cheers.
  • JamieOneilJamieOneil Member Posts: 877
    MagoNicolas said:
    You Must have an Attribute like: Wich One Draging
    And every time you drag one Stpe, you add a + 1 to it.

    Then you have every step with a number.
    And if the Wich one Draging is equal to one Step number, then you move that one.

    Hope I Explain myself.

    cheers.

    But how can i give every step a number if they are one actor ?
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    You Create a Self Attribute: My number

    Then you edit every one on the Scene, And Change That number, and you will have each step with an Unique Number.

    Cheers.

    _____________________________________________________
    image
    imageimageimageimage
  • JamieOneilJamieOneil Member Posts: 877
    MagoNicolas said:
    You Create a Self Attribute: My number

    Then you edit every one on the Scene, And Change That number, and you will have each step with an Unique Number.

    Cheers.

    _____________________________________________________
    image
    imageimageimageimage

    thanks for the help.
    I will try that :)

    JamieOneil
  • JamieOneilJamieOneil Member Posts: 877
    Okay i tried that, but people could go on this game for a while and it will lag.
    Any other ways ?

    JamieOneil
  • JamieOneilJamieOneil Member Posts: 877
    Last bump.
    Can anyone help?

    JamieOneil
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Here are my thoughts on this.

    1) This is not a game that GS can handle easily. So you may want to put this on the back burner in case GS makes performance improvements later on.

    2) If you are determined to make this game right now you are going to need to be creative and make some compromises. For example the taller the stack of blocks gets the more unstable the structure will be and that adds to the challenge of the game. But you may need to have a system where blocks that are far enough down get recycled and replaced by a scene wide nonmoving actor that becomes the "new foundation" for the blocks. This will be tricky - you'll need to figure out the logic and math behind when to recycle and how to exactly move the new foundation in without causing the blocks to fall. Here's another possible compromise. Give the player a set number of blocks to use and be sure that you have tested to figure out how many blocks can be in a scene before the lag becomes noticeable. Then have certain checkpoints throughout the game. When the guy gets to a check point the blocks disappear, a new starting point appears, and you start going up again. This will keep your block count at a reasonable number.
  • JamieOneilJamieOneil Member Posts: 877
    scitunes said:
    Here are my thoughts on this.

    1) This is not a game that GS can handle easily. So you may want to put this on the back burner in case GS makes performance improvements later on.

    2) If you are determined to make this game right now you are going to need to be creative and make some compromises. For example the taller the stack of blocks gets the more unstable the structure will be and that adds to the challenge of the game. But you may need to have a system where blocks that are far enough down get recycled and replaced by a scene wide nonmoving actor that becomes the "new foundation" for the blocks. This will be tricky - you'll need to figure out the logic and math behind when to recycle and how to exactly move the new foundation in without causing the blocks to fall. Here's another possible compromise. Give the player a set number of blocks to use and be sure that you have tested to figure out how many blocks can be in a scene before the lag becomes noticeable. Then have certain checkpoints throughout the game. When the guy gets to a check point the blocks disappear, a new starting point appears, and you start going up again. This will keep your block count at a reasonable number.

    The structure does get unstable.
    But i have thought of a way to recycle, you helped me with it in my last post.
    So i think i can make it run better now.

    JamieOneil
  • LumpAppsLumpApps Member Posts: 2,881
    If the staple doesn't get unstable you can ad a rule that stops them from doing anything once there on their final spot. That way they do not use any memory when they are in that position. I have done a similar thing in one of my apps. Problem there is they have to start doing all the rules when the collide with an actor but it works well.
Sign In or Register to comment.