What is the smallest increment of time that the Timer can measure?

BarrytheBarrythe Member Posts: 82
edited November -1 in Working with GS (Mac)
Hi all, I've set up a timer by using a Timer action to increase a real attribute by X amount every X seconds. The intended game is reaction time based so I want to have it record to the nearest 0.01 second. However the lowest increment I can reach is to add 0.04 every 0.04 seconds. Once I drop to every 0.3 seconds or below the timer looks as if it continues to count but the timing seems to go erratic and get out of sync.

My question is, is the gamesalad engine limited in that it cannot perform actions any quicker than every 0.04 seconds? I have only tested this within gamesalad preview mode, so is it possible that testing on an iphone will give the proper results? If not is there another way I can time to the 0.01 of a second? Thanks, hope someone can help.

Comments

  • BarrytheBarrythe Member Posts: 82
    Hi all, I know it's not cool to bump your own thread but within an hour of posting this it got knocked down to the bottom of page 2, I'm really hoping someone might have some insight in to my problem. In a nutshell all I need to know is wether gamesalad can measure in increments of 0.01 seconds, because testing from within gamesalad I find that any increments smaller than 0.04 seconds start counting quite slowly as if the engine can't cope with increments this small.

    Sorry for the rambling posts, but I can't get much further with my game until I know wether this issue will be present in an actual Iphone build. Once I have my apple developer account sorted I can quickly test this myself.

    Thanks all, if I still don't get any replies I won't bump again I'll just wait until I'm a subscribed apple developer and test it myself.
  • forkliftforklift Member Posts: 386
    I haven't confirmed this, but many users say that the best result of smallest time increment is 0.1 (only one tenth of a second).
  • BarrytheBarrythe Member Posts: 82
    Hi, thanks. I have seen a similar thread in which gyroscope says that 0.01 second is almost certainly possible, I've quoted below:
    gyroscope said:
    Hi; yes, 0.01's of a second can be got, pretty much certain. For most gameplay, you wouldn't need any smaller than that.

    Bit confused myself, what you mean here; but based on the stuff I posted earlier, the timing bit is:

    Make game real attribute called Timer (OK, call it Time to avoid confusion with the behaviour called Timer)

    When touch is pressed
    Timer behaviour
    Every 0.01 secs
    Change Attribute Time to game.Time+0.01

    Hope that makes it a bit clearer for you. :-) (I didn't lay out the first explanation very well for clarity, sorry about that!)

    I think its going to be a case of testing it on a device. Within gamesalad I've tested using 3 timers on screen, one updating every 1 second, one updating every 0.1 second and the last at 0.01 seconds. As expected the 1 second and 0.1 second say in sync, but the 0.01 second counts completely out of sync with the other two. All I need to do is test this setup on my iphone and I'll know for sure. Now to head over to apple to pay for a developer account... cheers!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I have heard that the timers are pretty unreliable when you start setting times below 0.5. Dont know just something I have heard.
  • BarrytheBarrythe Member Posts: 82
    Okay thanks, it sounds like maybe a bit of experimentation will be in order as there seems to be no record that I can find of the smallest reliable increment of time. Possibly it varies between devices, and even varies with each build of gamesalad. Once I am set up I'll experiment with a few timers on my 3gs and report back. If I share the gamesalad file I'm using to test it we might be able to get a range of readings from different users devices. If anyone is interested that is, I might be jumping the gun slightly - I haven't even made a game yet!
  • simo103simo103 Member, PRO Posts: 1,331
    I'm happy to help the common advance of knowledge .. I have a 2nd gen Ipod Touch that I'll be happy to run the viewer on and report back my findings so if you want to pass on a 'base' test file to keep the samples clean .. I am here simon [at] resqwest .net (note the dot net part)

    Might be fun and valuable to add other benchmark tests that people might find helpful being run on numerous devices. If anyone has ideas (or better still wants to create the file and pass it on). We could then rerun the test for 0.9.1 and beyond to see if certain things improve whilst others don't.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    I'm using increments of 1/3 of a sec. Seems ok so far, but I use the self.time as opposed to the timer attribute. Dunno if that makes a difference.
  • BarrytheBarrythe Member Posts: 82
    I like your thinking simo, although I must stress that I am a noob at gamesalad and I'm only starting work on my first small game, so I'm personally very limited in what I can do. My thinking was just a screen full of timers (1 second, 0.5, 0.1, 0.05. 0.01 etc) and then people could run the app on their device and report which is the lowest increment timer that stays in sync with the 1 second timer. From that we could build a list/spreadsheet type thing.

    I can attempt to get this made, although if anyone who knows what they are doing wants to attempt it that may be a more reliable option. Either way it sounds like a worthy cause.

    And shaz possibly the self.timer would give different results to the timer, maybe that could be incorporated in to the test?
  • ORBZORBZ Member Posts: 1,304
    on arm6 a timer w/ a resolution lower than 0.1 is unreliable (maybe 0.05 if you are lucky) and on arm7 devices a timer w/ a resolution of 0.01 or even 0 is possible (0 means as fast as the CPU can go)
  • RushDawgRushDawg Member Posts: 86
    This is a very timely topic for me, as I was wondering this myself.

    I am hoping that <0.1 resolution is possible.
  • BarrytheBarrythe Member Posts: 82
    Thanks for that orbz, I thought somebody here must have a knowledge of this. So presumably it's only older devices that feature arm6. If this is the case then a possibility may be to incorporate a switch in the game for the user to select their iphone/ipod model, and then only use the 0.01 second timer if they chose a capable model.

    Presumably previweing the game on the mac within gamesalad will also not allow 0.01 second intervals, but this will work when run on a capable device.
Sign In or Register to comment.