Managing efficiency in large platformer .. tips/tricks?
simo103
Member, PRO Posts: 1,331
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!
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
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!!
@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.