Game is not smooth
pokbluesky
Member Posts: 9
I am trying to make a game like space reider style. My background is 960x640 and it's moving endless. The background is never moving smooth. What happened? I've tried using either destroy&spawn or change attribute position Y of the background. Nothing works. Need help.
Comments
Sorry for bad quality. I make it quick.. Sorry
here the video
Move Direction 270 Speed 60
rule self.position.Y < 240
spawn actor self.position.x = 160, self.position.Y = self.position.Y + 480
rule self.position.Y < -241
destroy this actor
After I read some people said "Spawn" is load memory, i change spawn&destroy to change attribute and have two images with these rule
move direction 270, speed 60
Rule
Self.position.Y < -241
change attribute self.position.Y = self.position.Y + 960
it's still the same.. not smooth
I meant change velocity
Or you can try 'Supersampling' the move.
A lot of people are going to probably think it's rather strange, and it's a bit more costly to the cpu's processor than you'll want it to be, but it'll get you a smoother moving image.
Rather that using the 'Move' command use the 'Change Attribute' command to change the Y position of the image.
Every .01
Change Self.Position.Y To: (Self.Position.Y - 1)
Now here's the kicker. You're going to need a few of them to get it to the speed you want.. so be liberal. Also, if that's not smooth enough try fine-tuning the amount the image moves over time period given.
It's a bit costly, but you'll get better results for your background image. At least until you blow out your frame rate because you have too many rules.
I sent the game to you already, please check !
Sorry for little late. I am busy here
I've tried your method but I could not understand well about Supersampling. I will try again tonight.
You just need to run that same process (ie. moving the image in very small increments) many times. So instead of having one rule to move your image as you do now, you're having up to 10 or 20 different rules firing off at the same time to move the image.
Imagine it this way. Instead of one huge elephant pushing your image you now have twenty below carrying it.
I'm not saying it's good on the processor, but you shouldn't get the jumping in the image that you're seeing now. You're going to have to keep an eye on your frame rate however.
We actually did something similar to smooth out the accelerometer controls in Synth Racing, but that was a different game engine.