Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
deltaTime - problem please help.

cm20
Guest
Quote
2023-02-01 00:39:21

I have a problem with delta time - I've already researched here and tried several things. whenever I test on the web or on windows the game shakes a little when moving the player. I thought it was other things but I found out it's the delta time oscillation.

the problem is that I'm suspecting that the engine itself is buggy. not:
.prototype.onAnimate = function(node, timeMs){};
delta with this.currentTime = new Date().getTime();
and with timeMs the problem continues.

so if all javascript is executed by the ccb - it doesn't matter if the code is right. it will be called by the engine and a bug will appear.

but that's what I suspect. if anyone has a solution please.
the game is mobile it opens on the smartphone and on the emulator on the web and normal windows. the problem is the update - the delta time. the player's movement.


VP
Guest
Quote
2023-02-01 08:31:19

Is the scene very heavy, it could simply be frame-dropping due to high poly-count or high texture resolution?


okeoke
Registered User
Quote
2023-02-01 09:24:35

Hi cm20,

new Date().getTime() will get you your local device time. There timeMs which you get as a function attribute is just a timer which starts from 0 as your game starts. You should either use getTime() or timeMs constantly, since they are not the same date.

Also if you targeting the browser you should use Date.now() since it has a better performance.

Delta will oscillate if you don't have a constant frame rate, since it's just a value which shows how much time has passed since the last frame - and it's is design to work that way. You want to know that value in order to keep things like game object speed consistent with the different framerates on different devices, or busy/less busy scenes.


cm20
Guest
Quote
2023-02-01 14:08:49

@VP - It's not 35,499 polygons.
@okeoke - Thank you I will try what you said

thanks for answering.


cm20
Guest
Quote
2023-02-04 23:47:47

find out the problem even if the deltaTime is right. it was "locking" as if asking for FPS because of the smoothness of the camera.
if you put it high it locks if you put it low tb.
I did my own follow cam mode and it stopped flickering.

many thanks to everyone who replied.
@keoke, @VP


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (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