User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: Beta 8: Accelerometer Read Lag

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Beta 8: Accelerometer Read Lag

    There is a visible lag when using the accelerometer joystick. Maybe I'm scripting it wrong, but it seems that from one poll to the next one, there are some millisecs/frames in-between.

    I have attached an example file.
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    This is due to the way I have programmed it. I think I will ask Andos to look at it, he might have a better solution...

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    Maybe you can let us specify somewhere the wait in milliseconds between consecutive polls ...

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    Ok, this is really better in beta 10, but there's still a visible lag.

    Francois, did you programmed it as a sort of PID controller or it's just the milliseconds between polls?

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    The poll of the accelerometers is done every 1/50th of second. Andos changed the code so that the response is instant as soon as the accelerometers change. So I do not know what we can do more.

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    So, maybe it's the way I handle it. What do you guys recommend me to modify in my example above so as to instantly change directions?

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    Any ideas?

  8. #8
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    What is your frame rate set to?

    As Francois said, I modified the accelerometer joystick to instantly change direction as soon as it gets the value from the accelerometer.

    I had to put in a threshold value though where the joystick will be in it's resting state and it will not move.

    When you completely turn the device on the side, it will have an x-acceleration near 1 or -1 depending on which way you turn it. I programmed it so that when the tilt is between -0.1 and 0.1 it will not see it as you move the joystick which is probably why you perceive it as lag in your game (because of the way you programmed it with the events)

    In your example it seems you don't want the object to ever stop and that you don't want this "grace" value where it will not register the change of tilt. In that case I can only recommend you to use the accelerometer manually and read the gravity isolated value. That will give you more control and will work better for you.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    > In your example it seems you don't want the object to ever stop and that you don't want this "grace" value where it will not register the change of tilt.

    Exactly

    > In that case I can only recommend you to use the accelerometer manually and read the gravity isolated value. That will give you more control and will work better for you.

    Ok, I will. Thanks for the tip

  10. #10
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Beta 8: Accelerometer Read Lag

    I see that the accelerometer object has no actions and by default it will get activated in every frame that contains it.

    In my game, the use of the accelerometer is optional, but it will drain the battery even in cases where the player could have opted not to use it.

    So my suggestion is to add a new action "Set activation (0/1)" so that the feature can be turned on/off programatically (like the joystick).

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Beta 33 [Crash] when using a 'read button state' event in the first frame
    By colej_uk in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 28th August 2012, 11:54 AM
  2. Accelerometer in beta 31?
    By kiko in forum Android Export Module Version 2.0
    Replies: 4
    Last Post: 14th June 2012, 02:22 PM
  3. Read-Only Edit Box isn't really READ-ONLY
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 6th December 2011, 02:48 AM
  4. iOS5 beta and accelerometer object
    By xhedgehogx in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 8th September 2011, 08:32 PM
  5. Beta 3 - Accelerometer
    By Jeff in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 24th October 2010, 11:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •