Alternative to Bullet physic behaviour?

Get help using Construct 2

Post » Tue Sep 16, 2014 4:26 pm

I've been reading on ways to improve performance on my game and read that having too many objects using physics (Bullet behaviour in my case) can cause slow downs/frame drops.

I've got an endless runner game and i've got 7 seperate objects that use Bullet behaviour (4 or 5 of them are for backgrounds and the rest are for gameplay such as platform, obstacle & powerups). The bullet behaviour i'm using is from the auto runner template with just some tweaks to the bullet speed.

So i was wondering if there is an alternate method, other than Bullet behaviour, that i can use for some of my objects (mainly the background ones) so that it still has infinitie scrolling (as i've got right now) and in turn hopefully improve performance?
B
4
S
2
Posts: 111
Reputation: 830

Post » Tue Sep 16, 2014 4:53 pm

try this : everytick ==> set BG's X to BG.X -1
ImageImageImageImageImage
B
54
S
15
G
5
Posts: 852
Reputation: 11,346

Post » Tue Sep 16, 2014 5:48 pm

@Naji Thanks for the reply. I've tried it and although it does scroll as it does with the Bullet behaviour, it doesn't have Infinity scrolling, so it doesn't loop when it gets to the end of the sprite/image.

This seems like it could work but is there a way to make it have infinate scrolling/loop?
B
4
S
2
Posts: 111
Reputation: 830

Post » Tue Sep 16, 2014 5:51 pm

@SteveKane
I think it's fine using Bullet Behavior here. Using an "everytick scrolling" will not improve much.
But if you want the everytick method, use dt together.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Tue Sep 16, 2014 10:42 pm

This..?
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Wed Sep 17, 2014 12:12 pm

Try this ( on a tiled background sprite ) for getting your background to loop after scrolling? Its what I used for my infinite scrolling game and it works pretty well.
You do not have the required permissions to view the files attached to this post.
B
7
Posts: 61
Reputation: 417

Post » Wed Sep 17, 2014 2:30 pm

Thanks you guys for the replies, really helpful. Combining @RandomOutput method with @Naji works well but I went with @eli0s method, it does what i need without using physics or every tick, which i also read can have an effect on performance if used too much (although i'm not using every tick, i'd prefer to only use it if its really necessary)

Thanks again.
B
4
S
2
Posts: 111
Reputation: 830

Post » Wed Sep 17, 2014 2:55 pm

Glad you got it sorted, hope your project goes well and to see your game soon :) @SteveKane
B
7
Posts: 61
Reputation: 417

Post » Wed Sep 17, 2014 3:13 pm

@SteveKane , you can't avoid using every tick if you want smooth movement. In my example the every tick is included at the first condition, any event that is not a trigger (a trigger is displayed as a green little arrow on the left of the event) it's been calculated on every tick, unless its told otherwise. Even an empty condition is equal as like having the "on every tick" condition.

You could use the "every x seconds" condition to skip ticks and have less calculations, but this will also affect the smoothness of the BGs movement. Here is the same example with the movement at every 0.1 of a second (so it is effectively doing only 1/6 of the original calculations). As you can see, it's like a stop motion, but perhaps I guess that this can actually be aesthetically desired.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Wed Sep 17, 2014 9:34 pm

Oh OK, I didn't know that. Thanks for the info :)
B
4
S
2
Posts: 111
Reputation: 830

Next

Return to How do I....?

Who is online

Users browsing this forum: varr and 5 guests