About the jerkiness on the movement...

Discussion and feedback on Construct 2

Post » Fri Oct 31, 2014 2:42 pm

Another developer has identified and reported some v-sync issues in Chrome and Firefox. I've posted in their reports that this may be the issue behind the jank people have identified lately. Here's a list of bugs to follow if you want to track progress on this:

https://bugzilla.mozilla.org/show_bug.cgi?id=1080869
https://bugzilla.mozilla.org/show_bug.cgi?id=1028893
https://code.google.com/p/chromium/issues/detail?id=424563
https://code.google.com/p/chromium/issues/detail?id=422000
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Fri Oct 31, 2014 4:17 pm

Thanks @Ashley , I'm following the report now.

I did a little test(just visual) with high contrast colors to Jank not be missed.
The results are:

Aero theme disabled
Chrome 38:(wait a few seconds) a lot of Jank
Canary 40 64 bit:(wait a few seconds) a lot of Jank

It's funny that when Aero theme is enabled the result is very different:

Chrome 38: Doesn't feel smooth, but I can't see the Jankiness
Canary 40:Smooth and no Jank

https://dl.dropboxusercontent.com/u/46383802/HTML5/bugs/jank/index.html

Can anyone test this with Aero Disabled and Enabled?Maybe this just something related with my system specs.
Thanks
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Fri Oct 31, 2014 4:40 pm

Don't most people have Aero enabled these days? I think the latest Chrome Canary (v40) has the fix now, but I think it only works with Aero enabled. It measures a lot better on sbperftest here anyway in Canary.

I just read that Firefox also has "Project Silk", which includes improving v-sync timing reliability, and should eventually make it to all platforms (they're targeting Firefox OS first). So it looks like both Chrome and Firefox are aware of the issue and have improvements in the pipeline.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Fri Oct 31, 2014 4:55 pm

@Ashley Yes you are right, I do a lot of audio recording, and I have always the Aero Theme disabled to not waste resources, but usually people have Aero enabled.
OK, if the Jank is fixed in 1 or 2 releases from now, I'll be more than happy, it's on Chrome and Firefox hands now.

Thanks
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Fri Oct 31, 2014 6:41 pm

Thanks for the investigation and the bug report to Chrome, much appreciated!
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Post » Fri Oct 31, 2014 7:11 pm

Ashley wrote:Another developer has identified and reported some v-sync issues in Chrome and Firefox. I've posted in their reports that this may be the issue behind the jank people have identified lately. Here's a list of bugs to follow if you want to track progress on this:

https://bugzilla.mozilla.org/show_bug.cgi?id=1080869
https://bugzilla.mozilla.org/show_bug.cgi?id=1028893
https://code.google.com/p/chromium/issues/detail?id=424563
https://code.google.com/p/chromium/issues/detail?id=422000


Reading thru these bug reports is very interesting. This sounds like a lock for the regularly recurring jank reported by numerous C2 users. However, I don't think this bug covers all of the issues discussed in this thread.

IE still handles high garbage, high CPU load, and FPS degradation far more gracefully than FF/Chrome. Firefox especially devolves into a glitchy mess with workloads that involve large amounts of garbage (dozens of objects being created/destroyed per tick). Now, generally, as designers, we should avoid such cases (In my case, I'm using a pre-optimized version of my current project. The newer versions recycle almost all the objects I'm creating/destroying in the tested build).

The takeaway for me is this: even with a less efficient javascript engine, IE is providing much more stable performance than it's competitors.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sat Nov 01, 2014 1:06 am

I would probably not blame GC for any of the issues here. The engine is pretty good at recycling stuff. I mean it even recycles entire object instances. So even if you are constantly creating and destroying objects, it's actually internally recycling previously destroyed instances instead of allocating new ones. So you don't need to reproduce that in events. The rest of the engine has a similar approach of "recycle it all", so regardless of the content of your events, allocations and garbage creation should be minimal. Perhaps it is something else. Real demos with objective measurements are the best way to investigate it.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Sat Nov 01, 2014 3:54 am

@Ashley

Obviously, you understand how the internals of C2 work better than us. But, maybe you could take a look at this example capx and see if you see a difference in performance between forced object recycling and normal create/destroy operations. Click to toggle between modes.

https://www.dropbox.com/s/s2v4h18r172v4 ... .capx?dl=0

P.S. @GeometriX: I modded your capx for this.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sat Nov 01, 2014 4:50 am

@TiAm, holy shiz! I wasn't a believer, but you've converted me. I definitely see the difference in Chrome (60 FPS event-based recyling, 20-50 FPS without it). And this is on my development PC which is quite a beast (at least per my standards). After reading the articles about garbage collection I figured it'd be a waste of time to recycle objects beyond what C2 already does behind the scenes, but this has me convinced otherwise. Looking forward to seeing where this discussion leads!
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Sat Nov 01, 2014 5:47 am

TiAm wrote:@Ashley

Obviously, you understand how the internals of C2 work better than us. But, maybe you could take a look at this example capx and see if you see a difference in performance between forced object recycling and normal create/destroy operations. Click to toggle between modes.

https://www.dropbox.com/s/s2v4h18r172v4 ... .capx?dl=0

P.S. @GeometriX: I modded your capx for this.


I would almost say it is an issue of the browsers trying too hard to find and delete objects on their own. It gets so concerned with locating/destroying objects and cant keep up with the game itself. (Non-recycled has 2000 objects vs 5000 recycled)
Like I said earlier, the way the game works, only 1 thing really works at a time. So if the browser is focusing on figuring out what it should remove, vs us telling what to remove or even re-use it is going to slow things down.

I also don't think that has much to do with the Jittery movement. Garbage collection might help performance for objects off screen, but rarely should be a real issue.
If you need 2000+ objects all being animated off screen....you might be doing something wrong. Dynamic content creation would greatly limit how many objects you need.

I am fairly certain the issue comes with refresh rates/v-sync as @ashley was saying.
Locking movement at or below refresh rate removes all jittery movement.
This is for both aero and non aero browsing.

when I set my system to 144hz (144fps) the jittery movement can hardly be seen.
60hz and 60 fps, again looks smooth.

If I try to go above the refresh with movement, jittering is seen, more so at lower refresh than higher. Thats why I was making a big deal about the frames needing proper interpolation, tv's often do this. And in animation, getting smooth animations greatly comes from proper interpolation.
I'm willing to bet, a project that has invisible sprites as the actual game and "real" positions with visible sprites interpolating to those invisible sprites will get that "smooth" effect people here want.

I have to really really stress though, a square is much easier to see a jitter to movement than a fully animated player in an actual game environment.
in "real world" uses, this "issue" is not so much an issue as people are making it out to be.

Some1 feel free to yell at me if none of that makes any sense. I'm really tired today haha. And admittedly my brain is like bleghhh and spit forth thoughts. Enjoy :P
B
28
S
8
G
1
Posts: 226
Reputation: 2,865

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: BackendFreak, htmlgames and 28 guests