How do I fix scrolling issue....

Get help using Construct 2

Post » Mon Apr 28, 2014 3:32 pm

I'm trying to make a background where the fog scrolls endlessly but I'm having an issue with it. It seems to be fine up to a certain point and then for some reason it stutters, which doesn't look great. I don't exactly know what it's doing, it seems like after a certain point the image flips (maybe?) which causes the stutter, i'm not sure.

I've posted the capx file so you can see what i'm on about.

Hope someone can help.

Thanks
You do not have the required permissions to view the files attached to this post.
Image ImageImage
B
7
S
2
G
1
Posts: 91
Reputation: 1,239

Post » Mon Apr 28, 2014 3:56 pm

The problem is that you are not taking into account the actual image width (856 px) and that causes the jump.

For some reason I can't upload right now the fixed capx, but the event should look like that:

if Fog X <= (less or equal) to -856 ---> Fog set X to 0.

Also, the black Sky tilled object is a bit overkill in size! If you want a single BG color you could just set the bottom layer to be opaque and set its color to black. You can also use a sprite much less in size and stretch it to fill your sky, even a 64x64 with a gradient will suffice if you have pixel rounding set to Off in project settings.

-EDIT-

Ok, antivirus was messing around, here is your capx: http://www.eli0s.com/Tests/ScrollingFog.capx
Last edited by eli0s on Mon Apr 28, 2014 4:12 pm, edited 1 time in total.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Mon Apr 28, 2014 4:11 pm

@Ashley In rayrays' example I notice the same stutter phenomenon that we discussed in this topic https://www.scirra.com/forum/viewtopic.php?f=146&t=99765.

In general, the fastest the movement is, the more evident the discontinuity gets. Surely, there has to be a way to overcome this, I mean, I am previewing this on a very decent desktop, the fps are fixed at 60 and yet, if I stare on one point on my screen, the stutter is very prominent and it occurs constantly, some times even more than once every second.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Mon Apr 28, 2014 7:29 pm

@eli0s - the correct fix is to set the X to Self.X + 856. If you set the X to 0 you ignore any overshoot. At 750px/sec it's jumping about 12 pixels per tick, so it could end up as far as X = -868. If you just set X to 0 it will visually appear to jump by 12 pixels, but if you move it back by its own width it takes those extra 12 pixels in to account and remains smoother. With that applied it seems perfectly smooth.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Mon Apr 28, 2014 8:22 pm

@Ashley I stand corrected, I understand now the flaw in my logic. The result is indeed much smoother. But the stutter remains at the same levels as I describe it on the other post. In a little more complex scene (with a platform behavior and a couple of solid objects), every now and then there is a gap in the fluidity of motion. It's very small, not necessarily tied with a drop in frame rate (just enough times to raise suspicion) and, to my eyes, annoying. I tried to capture my screen at 60fps to show you what I mean, but using a screen capture software really destroyed the frame rate.
Perhaps it's just me. I am one of those guys that was annoyed with the old CRTs because of the flickering.
Thanks for your response, I learned something again today!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Mon Apr 28, 2014 8:33 pm

@eli0s @Ashley Thank you for your responses. That's really helped me out with my issue so i appriciate you guys taking time out to help. Also, i only used a black background because i thought it would be clearer to see the fog (probably not the smartest idea lol) and i already had one on my desktop as i was working on something. My background is going to be in much more than just plain black :)

Thanks again.
Image ImageImage
B
7
S
2
G
1
Posts: 91
Reputation: 1,239


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Yahoo [Bot] and 23 guests