Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Different timings on different machines  (Read 2753 times)

0 Members and 1 Guest are viewing this topic.

wisemanxxx

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
    • View Profile
Different timings on different machines
« on: May 12, 2010, 08:18:43 PM »

How can I set a fix timing for every machines?
I have a puzzle routine like this:
There is a indicator which moves in a range with a fixed speed. And player must click mouse when indicator on red areas. I hope I can tell my problem.
I tested routine on different machines and indicator runs fast or slower depends machine's speed.
and my fade in fade out routines are also run at different speed on different configurations.
I use Sleep function for this. When I want to faster indicator or faster fade in fade outs I use Sleep(1).
Can I fix this problem.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Different timings on different machines
« Reply #1 on: May 13, 2010, 06:52:28 AM »

Scripts are updated once per frame. So even if you call Sleep(1), the script will not sleep for 1 millisecond, but until the next update. For example, if your game runs at 60 frames per second, the script will be updated approximately every 17 milliseconds (1000 / 60). So for consistent speed you shouldn't use sleep values lower than 1000 / expected minimal framerate of your game.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

wisemanxxx

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
    • View Profile
Re: Different timings on different machines
« Reply #2 on: May 22, 2010, 07:59:58 PM »

thank you so much.At last I understood... :)
Logged
 

Page created in 0.036 seconds with 24 queries.