**Constrain Optimization Question + Efficient Method**
ShineHouseGames
Member, PRO Posts: 100
Hey everyone, quick question:
Which of the following is more performance heavy?
Constrain (self.image) to (game.score)
// OR //
When (0.04) > (game.Time)%3, Change (self.image) to (game.score)
Is the difference still negligible in a larger game? Thanks for any input.
Which of the following is more performance heavy?
Constrain (self.image) to (game.score)
// OR //
When (0.04) > (game.Time)%3, Change (self.image) to (game.score)
Is the difference still negligible in a larger game? Thanks for any input.
Comments
When (self.image) /= (game.score)
{Do nothing}
Otherwise:
Change (self.image) to (game.score).
To be honest, I think all of the ways listed are pretty equal, performance-wise.
Both Rules and Constrains fire as often as possible, too many of either will start to bog down the system.
I think I might actually prefer the Constrain in this case, because it is not doing any logic.
Although constantly changing an image all the time is probably a pretty heavy thing too!
So always change an image a zillion times a second, or perform some logic a zillion times a second, and then also change the image but not as often!
A good question!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS