Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Timer and GetFrameTime

Author
Message
Crystal Noir
AGK Bronze Backer
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location: France
Posted: 13th Sep 2011 10:51 Edited at: 13th Sep 2011 10:51
Hi everybody,

Yesterday I looked for this example in the doc :

http://www.appgamekit.com/documentation/examples/timers/1_timer_movement.htm

I wonder, this is not the same thing that use the GetFrameTime() command ?

See here : http://www.appgamekit.com/documentation/Reference/Core/GetFrameTime.htm

It seems that GetFrameTime() command return the same things that the difference# variable on the sample, doesn't it ?

I try to play with timer based movement, but I have the impression it's more easy to use GetFrameTime() instead of a lot of calcul in the loop.

I don't know that's why I ask the question, may be it's not the same thing ?

In add, it seems that when we use a timer based movement we have to choose a great number to make sprite move quickly (like 100 or 200 per frame).

Thank you for help
Crystal Noir
AGK Bronze Backer
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location: France
Posted: 17th Sep 2011 11:06
Waow Nobody knows ?

What about the vsync ?

Thank's
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2011 11:18
Quote: "What about the vsync ?"

V sync have well bin removed to get it to work better on more devices?

Thats why some people gets some screen tearing on there apps.

I have bin thinking exactly the same as you about the GetFrameTime()

I simply use the version from the sample of timed movement that comes with the agk
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2011 12:51
I just bumped this as your right
i replaced my code with only 2 lines!

global GFT#

do
GFT# = GetFrameTime()

move sprite bob,200.0*GFT#
sync()
loop

No nead for calculations or any functions as its built in to tier 1
Crystal Noir
AGK Bronze Backer
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location: France
Posted: 17th Sep 2011 13:03 Edited at: 17th Sep 2011 13:04
Thank's

For vsync, without it, the apps are not smooth. And on Windows / mac we have screen tearing.

We need this command to have something that is correct imo. After, people are free to use it or not (depends of the device).

In add, may be it's possible to activate it on tier 2 ?
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2011 13:39
Give the tgc it as an request about the v sync ?

i dont have any screen tearing yet in my app, so i dont nead it right now
Crystal Noir
AGK Bronze Backer
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location: France
Posted: 17th Sep 2011 13:56
It depends of a lot of things. Screen tearing appears if you monitor sync is not the same of the game sync.

Wait for the sync is better to make the game be able to be smooth on different PC's.

With the base timer movement, that's permit to make the apps smooth whatever the PC.

But I wonder if we can setup the vsync on tier 2, may be with some c++ commands ?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th Sep 2011 19:42
in Tier 2 use

agk::SetSyncRate(60,0);
Crystal Noir
AGK Bronze Backer
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location: France
Posted: 17th Sep 2011 20:49 Edited at: 17th Sep 2011 21:04
we have in tier 1 setsyncrate too.

But it's not the same thing. With this command you limit the fps to 60 but do not activate the vsync that permit to synchronise the screen refresh time with the game.
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 20th Sep 2011 19:13
If you make a request in the issues board, we can look at it down the line: http://code.google.com/p/agk/issues/list

I drink tea, and in my spare time I write software.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Sep 2011 22:02
Lee its always good to have the option to use it or not

Love the agk by the way

But please get on with the bugg that crashes apps with an bytecode around 900 kb-1 mb

Login to post a reply

Server time is: 2024-11-22 04:49:48
Your offset time is: 2024-11-22 04:49:48