Managing efficiency in large platformer .. tips/tricks?

simo103simo103 Member, PRO Posts: 1,331
edited November -1 in Working with GS (Mac)
I am trying to tighten up a platform scene and can't find an answer so I'm hoping someone can help.

I have moving platforms, bubbling volcanoes, steam etc all over the place in a large scene. So this is the issue ... I believe those actors movements (although completely out of camera view until the hero gets there), are eating up FPS/cpu ... is that correct? If so I was thinking I would activate them based on proximity to the hero but constraining magnitude would then always be running.

is there any tricks/tips the pros use? Does/can the camera tracking trigger certain events when it gets to certain locations or is my option to place invisible actors around the scenes and have the Hero trigger actors 'in the area' based on his arrival and then turn them off when he departs.

thanks for any insight!

Comments

  • XpandemicXpandemic Member Posts: 157
    I'm no pro but this could work, add an invisible attribute before that specific scene shows up and when the player touches it the volcano and all the other stuff activate; then have another attribute at the end deactivate them. Hope that made sense :P
  • DrGlickertDrGlickert Member Posts: 1,135
    You could try an attribute on the individual actors.

    So, for example, on the volcano;

    self.distance

    Then set up a rule on the volcano that when the distance is LESS THAN or EQUAL to (whatever value you want, 10 or 100, or whatever) then do volcano type activities (explode, steam, lava, whatever).

    I'd have a game.attribute that is PlayerX. In the player do two constrain attributes game.PlayerX to self.player.position.X

    Then do a simple math equation on the volcanos (and other actors) Change attribute self.distance to game.PlayerX - self.volcano.Position.X

    As the player gets closer that value will go down and then when it hits your predetermined distance (10, 100, or whatever) it will start it's activity. Then when the player goes by it, the volcano will stop.

    Hope that helps and works for you!!
  • simo103simo103 Member, PRO Posts: 1,331
    @Xpandemic thanks that was the default idea I had.

    @DrGlickert .. thanks .. my concern with that is that you have then the hero action constraining position all the time and a bunch of actors all over the place are checking to see if they are close ie: ones far away might be wasting the efficiency by that calculation even when they are nowhere near.

    I'm hoping there is a trick with the camera position that I haven't come across or something.
Sign In or Register to comment.