Jerky Panning

Get help using Construct 2

Post » Mon Feb 24, 2014 12:02 pm

Hi,
I'm using bullet behaviour on an invisible sprite to do a movie-like pan around a large map. The panning is quite jerky at times. Here's the file...

https://www.dropbox.com/s/0g54ap4bcugno ... Jerky.capx

The background sprite is large. Is this the problem? Do I need to chop it up into small tiles?
Cheers,
Martin
B
6
S
2
Posts: 18
Reputation: 594

Post » Mon Feb 24, 2014 12:24 pm

Wow... 82Mo for the capx ? I bet the image is rather large in fact ! Maybe you should use smaller resolution ? I'll take a look after download, but this isn't a good sign... How much VRAM does your program take ?

When something is lagging/not working right, try to use the Debug Layout feature, as there is a tab with Performances Profiling, helping you understand where the bottle neck is.

EDIT after DL : yes, try to cut your image in multiple pieces. This is the origin of your problem here. After all, there is only 3 objects for now, and I'm already at 40FPS (bad computer but still)
B
17
S
8
G
4
Posts: 473
Reputation: 6,221

Post » Mon Feb 24, 2014 1:14 pm

I think it is because your invisible sprite is getting to its location and then constantly correcting - therefore that (the invisible sprite) is shaking which is causing the screen to shake (scroll to behaviour)

https://dl.dropboxusercontent.com/u/143636437/big%20scroll%20to%20test.capx
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Mon Feb 24, 2014 8:46 pm

Thanks!

Is there an easy way of chopping a large image like this into smaller chunks, then arranging them again in C2? I'll be using GIMP. what size chunks?

Cheers,
Martin
B
6
S
2
Posts: 18
Reputation: 594

Post » Mon Feb 24, 2014 9:28 pm

Thanks RamPackWobble,

so your capx seems to show that it's not my large sprites that cause this problem? Any solutions?

Cheers,
Martin
B
6
S
2
Posts: 18
Reputation: 594

Post » Mon Feb 24, 2014 10:34 pm

Get rid of the scrollto to and use the system scroll.
always set scroll x to lerp(scrollx,bullet.x,1-0.05^dt)
- set scroll y to lerp(scrolly, bullet.y, 1-0.05^dt)
B
172
S
50
G
182
Posts: 8,439
Reputation: 115,097

Post » Thu Feb 27, 2014 12:11 am

Thanks Newt,

'works a treat - a tiny bit of jerkiness (probably due to my large image), but quite acceptable.

What's the reason for the 1-0.05^dt bit? (I replaced this with a variable so I could easily fiddle with the timing)

Cheers,
Martin
B
6
S
2
Posts: 18
Reputation: 594

Post » Thu Feb 27, 2014 12:17 am

Ehh its just a small number for testing. Something *dt will do fine.
Image ImageImage
B
172
S
50
G
182
Posts: 8,439
Reputation: 115,097

Post » Thu Feb 27, 2014 8:28 am

sorry - I missed your reply ( if you add @username to your post then that username gets a message and knows to look). Anyway all sorted now ?

(and I have also just seen that I can tick a box to get Notified when a reply is posted - so I will give that a try)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Thu Feb 27, 2014 8:39 am

@RamPackWobble
You can also, from your control panel, set this box checked by default. Quite useful.
Would even be nicer to get notified via the notification system of the forums, and not only by mail though
B
17
S
8
G
4
Posts: 473
Reputation: 6,221

Next

Return to How do I....?

Who is online

Users browsing this forum: draiza, Yahoo [Bot] and 4 guests