Running at 60 frames a second but...

mataruamatarua 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@

Comments

  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Seems it is the rate at which my bullets are firing affects only selected actors - hmmm - trying to do a massive optimisation run with this at the moment... will see how it goes.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    So does it run smoothly if you don't fire any bullets? ...
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Yep it does stormy - and I have been playing with bullet settings and rotation speeds too - the faster the rotation the the bigger the jumps.

    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!
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    Cool, the recyling certainly sounds like the best plan.... it's annoying to setup, but once done at least it could solve the problem.

    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
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    The bullet is only a gamesalad block, it was a lazer that I was changing width on but have removed that part in optimisation.

    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.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @StormyStudio when I built this game I just prototyped it as fast as I could just using masses of spawns and timers as they are easy to get something up and running always with the intention that once I had it to a certain level I would optimise - remove timers - recycle instead of spawn etc. It was running so well with masses of spawns and timers I was pretty amazed.

    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.
Sign In or Register to comment.