Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Smooth movement?

ddabrahim
Registered User
Quote
2017-12-16 10:51:21

Hi.

I would like move a scene node left and right on the X axis but I have noticed the movement is not smooth.

What I mean, when I press a key down, the object move once then stop for a moment then continue the movement but the movement is a bit lumpy like the FPS would be low or the scene would be not rendered every frame.

I tried using the built-in actions to change position of the node, I also tried the custom action from the tutorial to move a node:
https://www.ambiera.com/coppercu...
And I also tried using JavaScript:
https://www.ambiera.com/forum.ph...

Whatever I try I get the same results on both Windows and WebGL.
I notice the same problem actually in the game Painted Legend which is made with CopperCube.
And I also notice the same in the Terrain Demo, it feels like not every frame is rendered when I'm moving around.

Is there anything else I can try?

Note that, I can not use Physics to move anything because my target platform is WebGL and it got no physics to move anything I believe but I wish I would be wrong.

Any help would be appreciated.

Thank you.


wild-master
Registered User
Quote
2017-12-16 14:53:49

You should set variables, and move your character based on which variables are active.

Example:
If Left button is pressed, the variable "MoveLeft" equals 1.
If Left button is released, the variable "MoveLeft" equals 0.
If "MoveLeft" equals 1, the character node will move Left.

If you do that, the movement will be very smooth.

Try this CCB file that I gave to another person with the same problem:
https://drive.google.com/file/d/...


ddabrahim
Registered User
Quote
2017-12-16 16:07:38

Thanks a lot for the example.

It is probably something on my part because it is not smooth on my end.
More noticeable if I slow it down to move only 1 pixel/frame.

On my end it seems like there is a break between each draw call and the screen get updated only every 10 frames or something. Not smooth at all.

It might be a compatibility problem with my hardware or my graphics driver.

Thanks anyway, I'm appreciate your help.


ddabrahim
Registered User
Quote
2017-12-17 11:25:56

@wild-master

I have tried on a different PC with a different GPU and SSD and I get the same results.

Is it really, totally smooth on your side and am I the only one who is experiencing that small jumps/frame drops?

Not only in your example but also in the Terrain demo and the game Painted Legend.

Could anyone tell me how can I display an FPS counter to see if the FPS actually drop on my side or is it glitches with drawing the screen only?

Thanks.


ddabrahim
Registered User
Quote
2017-12-17 11:44:29

I've found the checkbox to display FPS. If that is correct, the FPS does not drop.


ddabrahim
Registered User
Quote
2017-12-17 12:02:45

In the publishing settings for WebGL I checked the box to wait for all textures to be loaded, for Windows I switched to OpenGL and also checked the box for vertical sync and it seems to solved the problem :)


just_in_case
Moderator
Quote
2017-12-17 12:39:51

you can use acceleration and deacceleration for the movement of your object scenenode... It may help you with the smooth movement..


ddabrahim
Registered User
Quote
2017-12-17 13:39:06

Thanks.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact