ORBZ Drawer?

ShineHouseGamesShineHouseGames Member, PRO Posts: 100
edited July 2012 in Working with GS (Mac)
This was in a previous discussion, but nobody seemed to have an answer. The OBZ drawer demo has some serious lag on my devices, and is the clear cause of my game's lag.

I can't use a different system though, because I need the lines to stay where they are for over a second... Anyone have any ideas on how to decrease the lag?

Comments

  • ORBZORBZ Member Posts: 1,304
    edited July 2012
    First of all, are you sure it's the drawer that is slowing your game down? Perhaps its something else you've done? Try the basic drawer example on your iPhone, it's pretty fast on my iPhone4.

    Two suggestions:

    #1 try replacing the core 0.1s Timer with this modulus rule (it may help):

    game.cputime = 0.5

    rule when game.cputime < game.time%0.1


    #2 If #1 doesn't speed things up, and honestly it may not.... you can pre-allocate a whole bunch of "segment" actors and then dynamically position them using an index. The problem with this is that it limits the length of the line to however many segments you pre-allocate. I think 50 or so would be a good start. You would then, in effect, be recycling the same actors. This cuts out the Spawn Actor behavior and should improve performance at the expense of added complexity.

    Also, make sure your segment actors have Physics > Moveable unselected, this ensures that they are optimized when processed by the physics engine (since it presumes they don't move it can skip a lot of calculations) and improves performance.
  • ShineHouseGamesShineHouseGames Member, PRO Posts: 100
    Thank you for the detailed response!

    I'll try both (though the second one seems a bit complex, especially because my game really revolves around the already implemented drawing system).
  • ORBZORBZ Member Posts: 1,304
    Sure, just try the first experiment first. Does the drawer itself, without your game, just the example run slow on your device? If not then it's something else you've done in your game that is slowing it down.
Sign In or Register to comment.