To many Timers?

BaDDAppleBaDDApple Member Posts: 49
edited November -1 in Working with GS (Mac)
I have been reading posts about optimization and having to many timers can be bad. I have spawner with at least 10 timers that launch different actors randomly on screen the player must avoid. The actors do destroy themselves when they reach a certain height. I wonder if having this many timers is bad or should I come up with a rule set where I have one timer that spits out a random numbers and than based on the number launch the actors. Would that be better? Thanks to the community for their help. I have learned a lot by reading the forums.

BaddApple

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    My spawners consist of a set of rules governed by one timer.

    So, you have a timer actor that counts up.

    Then, in your spawner, have a rule that says:

    When timer = 10, spawn fighters at X,Y

    When timer = 20, spawn battleships at X,Y

    and so on.

    The last rule says:

    When timer = 240 (or whatever)

    Spawn 'Level Complete' Actor
    Destroy Timer.

    Does that help?

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • BaDDAppleBaDDApple Member Posts: 49
    Is there a way to check FPS or do you have to have the Pro version?
  • POMPOM Member Posts: 2,599
    sorry for the bump but i didn't want to start a new topic,
    @tshirtbooth,
    in my new game i have a lot of timers, the thing is that the FPS is above 40,
    but before i added the timers the RAM was about 20-25 and now its about 40-45 !!
    the FPS is still 40 + ..... is it ok?! what is affecting RAM usage?
    (its 40-45 and even without sounds and full graphic )
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Graphics, rules, everything affects ram... I think 45 mg of ram kills the 1st gen devices.. So your probably going to need to do some heavy optimization on those timers...
  • POMPOM Member Posts: 2,599
    HOLY SHI.......... COW..
    i just discovered a very strange thing, i have a timer (after 2 sec spawn actor)
    with this time the RAM is 43 usage at initial start, without this timer its 38!, a single timer increase the RAM 5 mb more !?!?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Its not the timer, it the spawn behavior. Whatever actor(s) you are spawning are adding to the RAM usage.
  • POMPOM Member Posts: 2,599
    well this information is priceless ! how do you know this facts?! thanks a lot .
    i just confirmed this, but why is this happening? the actor that is spawned is not heavy ruled ,
    i mean , 5 mb of RAM ?! why?
  • AfterBurnettAfterBurnett Member Posts: 3,474
    quantumsheep said:
    My spawners consist of a set of rules governed by one timer.

    So, you have a timer actor that counts up.

    Then, in your spawner, have a rule that says:

    When timer = 10, spawn fighters at X,Y

    When timer = 20, spawn battleships at X,Y

    and so on.

    The last rule says:

    When timer = 240 (or whatever)

    Spawn 'Level Complete' Actor
    Destroy Timer.

    Does that help?

    QS :D

    Dude, so simple, yet so elegant... wish I'd done it this way! I shall for the current project ;-)
Sign In or Register to comment.