Running at 60 frames a second but...
matarua
Auckland, New ZealandMember Posts: 854
I have a space game that has actors constrained to rotate and follow cos and sin equations. Things are pretty full on in this game but they have gone kind of smoothly in regards to the actors movement up until now.
The game runs at 60 frames a second but the actors seem to not constrain smoothly - skipping.
It's almost as if they jump back a little.
They are constraining with cos and sin on x and y using self.Time and there can be quite a lot of them on stage at one time.
I had a lot of timers in this and I was always going to get rid of them and set up a different system. I have done that which usually gives a good performance bump but I am still having this issue.
It is also a bit strange that when I had say 8 identical actors come out in a stream the first one has the skipping issue but all the following ones don't. They are the identical actor.
Sometimes when there's only one on screen it will do it too. Then when there's lots it won't.
Odd - but it's reporting that it is running fine...
Any ideas what could be causing this?
Thanks, M@
The game runs at 60 frames a second but the actors seem to not constrain smoothly - skipping.
It's almost as if they jump back a little.
They are constraining with cos and sin on x and y using self.Time and there can be quite a lot of them on stage at one time.
I had a lot of timers in this and I was always going to get rid of them and set up a different system. I have done that which usually gives a good performance bump but I am still having this issue.
It is also a bit strange that when I had say 8 identical actors come out in a stream the first one has the skipping issue but all the following ones don't. They are the identical actor.
Sometimes when there's only one on screen it will do it too. Then when there's lots it won't.
Odd - but it's reporting that it is running fine...
Any ideas what could be causing this?
Thanks, M@
Comments
It never waivers from 60FPS tho. It does have issues with the amount of contrains perhaps and the frequency of the bullets.
The bullets are spawned as they are coming out fast from the spaceship - and destroyed once hitting an object.
I am currently changing as much as possible to a recycling method too.
Optimising as much as poss!
How do the bullets move? interpolate, Move, accelerate?...
Is your bullet image the same size as the actor... can you do away with an image all together?
Good luck
J
It is a constrained rotation, vector to angle to face the center.
It is then accelerated, with a vector to angle equation to the center also.
It's destroyed when hitting an alien or the black hole, and was firing every 0.2 seconds. But they build up as you power up.
This means you have four streams of bullets from different locations firing at that rate.
So to combat the high rate of bullets I have slowed them down to slower rates so far. I tried doing a recycle on the bullets but that did not work too well.
This has helped - the game is pretty manic and has a lot going on so it was always going to be a bit resource heavy. It just seems to have gotten worse lately for some reason.
Ideas I have is to make the bullet a circle so it does not have to rotate, that takes out the constrain which might help.
But recently - maybe due to the new amount of alien actors and the more rules being applied it started to have skipping issues. So the last two days I have done optimisation. I have just completed that part and created a system that spawns the actor and then once it is spawned it recycles. This has removed a lot of timer 'mod1' (modulate) type rules from delivering the actors.
It's working well now doing it by recycling - seems smooth as trick now is to get more of them in there and see how it handles it.