How do I smooth move forward?

Get help using Construct 2

Post » Fri Sep 19, 2014 10:46 am

I guess "micro stutter" is an accurate description and I am afraid there isn't a way around it. This occasional jagged motion is very evident to some people, less noticeable to other (much to my surprise), in any case, it has been described in other topics and there hasn't been a clear explanation for the cause of it, nor for a solution.
For me is extremely evident in platforming projects. I can get my self to get use to it while I am testing but, at the same time, I thing of the Mario brothers game on NES and how smooth its motion was... and that is puzzling me: on a modern platform like C2 these kinds of problems should have been ironed out by now. Yet, I see very few people bothered by this, or even noticing it.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Fri Sep 19, 2014 11:19 pm

JavaScript's garbage collection (GC) is one cause of stuttering. It's gotten better over time because web browsers are implementing ways so the GC causes shorter stalls. Some are better at this than others.

Another reason is stuff running in the background, the underlining os can be as much of a culprit as other programs. The nes had a lot less variance since only the current game was running.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Sat Sep 20, 2014 12:01 am

@R0J0hound , thanks for your input!

I know nothing about the garbage collection process (I've read about it as been a problem in general on other topics though), but any word coming from the great R0J0 I' ll take for granted :)

As for the background processes, I get that windows and all the junk I have installed on my system are taking their toll on my PC, but shouldn't this be as true for other games too? My rig is not in its prime any more, but it can still play most modern 3d titles on high settings, with no stutters or other noticeable frame drops.

To be frank, being as ignorant as I am, I can't help wondering how it is possible for a 3d game engine to calculate and render all those polygons, huge textures, complicated shaders, real time lights/shadows and post effects, and at the same time run smoothly!? Of course there are geniuses behind those engines that optimize everything and squeeze every last redundant bit out of the game, but still, I would expect a 2d engine that doesn't have to deal with most of those things to deliver rock solid results on simple scenes, and I even hopped that its lack of third dimension would give it an edge on what it can display on the other two dimensions.

I fear that this is all about choosing HTML5 as a target platform, although I have no technical knowledge to support it, nor that it really matters, C2 is what it is and does what it does.
Last edited by eli0s on Sat Sep 20, 2014 4:51 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 » Sat Sep 20, 2014 1:28 am

Other stuff running in the background have much less of an effect than Garbage collection. Garbage collection is automatic and in javascript you can't control when it happens as far as I know. Ashley has done a lot to keep the amount of garbage made by the engine to a bare minimum according to his blog posts.

I don't really notice the lag, but then again my pc is dog slow with html5 as it is.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Sat Sep 20, 2014 3:46 pm

R0J0hound wrote:I don't really notice the lag, but then again my pc is dog slow with html5 as it is.


So, if I understand you correctly, you don't notice the lag because even if it exists, the performance of html5 in your pc is already bad and you wouldn't be able to distinguished it?

I am curious about these optimizations because I have stuttering issues even using 2 sprites, one for solid objects and one for the player with the platform behavior. I am talking about single frame square sprites.

Some time ago, due to my frustration by this issue, I wanted to make a topic and post a video of this, but when I tried to screen capture the previewing capx, the screen capturing software really messed up the frame rate on the browser. So the issue sifted from the subtle and sporadic stuttering to an inaccurate representation of framerate drops.
In short, I have no tools to document accurately this issue, other than writing in terrible English about it. But it is there and it's too evident for pleasurable experience, at least in tight platforming games, in my opinion.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Sat Sep 20, 2014 4:36 pm

Sigh, guess I have no choice then but to leave it in and hope that most people that end up playing it won't notice/won't be bothered by it..:(
Oh well, thank you for trying to help guys.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sat Sep 20, 2014 5:08 pm

@eli0s
Maybe I've become accustomed to it.

I did a bare basic js test of motion and even then it's not buttery smooth.
http://jsfiddle.net/us1v4sq4/1/

Also added a graph of the frame time to inspect it further
http://jsfiddle.net/us1v4sq4/2/

For me there are some little spikes in the frame time, but it doesn't really correlate to the motion.
Not sure what can be done to improve it. The issue may lie in the web browser itself.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Sat Sep 20, 2014 5:42 pm

@R0J0hound , I tried your javascript tests and I can confirm your results:

Firefox: random spikes and some uncorrelated stuttered movement
Chrome: Almost no spikes and a few occasional jumps in movement
IE 11: no spikes but some stuttering detected.

Those results above reflect my experience with actual C2 projects in the same browsers.

Unfortunately I can't get my self to be accustomed with it. I don't mind this while I test and fool around trying to learn C2, but as a consumer, I would have been very disappointed playing a game that has sporadic jumps&drops in fluent movement. If this is something I have to swallow by accepting html5 as a gaming platform, I find my self agreeing with the camp that had raised the need for other exporting solutions so many times now, it's just not ready yet, it's unprofessional and sloppy to deliver something that has intrinsic flaws like this.

Anyway, the original poster has a solid answer now, thank you again for the input R0J0, it's valuable and constructive to interact with you :oops: :lol:
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Mon Nov 03, 2014 5:08 pm

I have actually experienced something similar to this on a much smaller scale. I built our basic website using C2 ( currently living at http://50.112.151.9/home ), and I found that when using a time-based solution to having the menu items scroll-up, the speed at which it moves varies based on the machine and browser it is run on. I suspect this particular behavior is due to inconsistent clock timing.

I am not sure if this clock issue is related, but from a physical standpoint, any deviation in timing will result in micro-stutters, as they are described.

I ran that Jsfiddle on my machine also, and I only had 1 or 2 spikes and the rest was very consistent, so that is very likely browser-specific or perhaps even machine-specific.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Previous

Return to How do I....?

Who is online

Users browsing this forum: Construct Monkey, David181, luckyrawatlucky and 6 guests