Hi All,
I work with a lot of animations with LC and would like to get a better grasp of FPS in livecode and if my approach is correct and any optimization tips or links.
At the moment what I do is if I make a animation built with 12FPS and want to add it to a project I use the "send" command and divide 1000 by 12 which is 83.3 and send it to me. (1000ms = 1 second)
Is this approach a good practice? and what other methods do others use. thanks.
Frames Per Second Best Practice
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Frames Per Second Best Practice
Hi Istech,
I understood the send command is better than repeat loop.
The main problem for you is what doing during 4 milliseconds 1000-(83 * 12) = 4
Best regards
Jean-Marc
I understood the send command is better than repeat loop.
I think you have to use round function to get an integerdivide 1000 by 12 which is 83.3 and send it to me
The main problem for you is what doing during 4 milliseconds 1000-(83 * 12) = 4

Best regards
Jean-Marc
https://alternatic.ch
Re: Frames Per Second Best Practice
In videogame programming, no matter programming language you use, the best effect are cheating user senses.
If you need speed, sometime the best effect is to skip some animations. The classic example is the rolling wheel that go faster and faster:
no animation
infinite animation
just 3 animation loops
GIF speed is setted inside GIF, not by Livecode.
another way is to use tick instead of seconds:
but probably the last way is too fast, and it's difficult to control the pendingMessages list.
If you need speed, sometime the best effect is to skip some animations. The classic example is the rolling wheel that go faster and faster:
- bad programmers write a cycle that rotate wheels of 1 degrees per cylce and speed up the cycle
- good programmers use always the same time for the cycle, but the increase the angle rotation per cycle
no animation
Code: Select all
set the repeatCount of image "MyImage" to 0
Code: Select all
set the repeatCount of image "MyImage" to -1
Code: Select all
set the repeatCount of image "MyImage" to 3
another way is to use tick instead of seconds:
Code: Select all
send animationAdvaceOneFrame to me in 2 tick
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Frames Per Second Best Practice
Thanks for the useful info.MaxV wrote:In videogame programming, no matter programming language you use, the best effect are cheating user senses.
If you need speed, sometime the best effect is to skip some animations. The classic example is the rolling wheel that go faster and faster:
- bad programmers write a cycle that rotate wheels of 1 degrees per cylce and speed up the cycle
- good programmers use always the same time for the cycle, but the increase the angle rotation per cycle