Can a looping interpolation stop maintaining a constant speed?

ellfireellfire Member Posts: 187
edited February 2012 in Working with GS (Mac)
Hello everyone. I've run into an odd issue and didn't know if someone out there may know why its happening and/or how to fix it.

I have a large stationary character that I have made "walk" (scrolling world but it's stationary.) It's legs consist of two parts: thigh to knee and knee to foot. I am using looping interpolation commands in both segments to create my walk cycle.

Ex. For the knee, it rotates form 0-20 degrees in one second, and then 20-0 in one second. At a same time it moves forward in X for 1 sec. and back to the start X in 1sec. Together, this creates a 2 second loop.

The knee to foot region moves from starting X to new X in one second, then new X to start X in one second. The foot also interpolates from its starting Y position to a higher Y position in 1/2 a second and back again in another 1/2 second. This makes the whole foot lift as it moves forward, then slides along the ground back to its starting X position.

When I view this in the GS preview, everything is fine. When I preview it with the GS Viewer on my iPad, after awhile the two actors seems to go out of sync. Does anyone know why this could happen? Is it something with the GS Viewer? I can't imagine how two interpolate commands that run from one to the other at a constant rate could get out of sync as they can't be affected by outside variables.

Any help or ideas are greatly appreciated. (Maybe there is someway to constrain the movement and rotation of the thigh to the forward and backward motion of the foot?)

Comments

  • ellfireellfire Member Posts: 187
    Well, I'm still interested in finding out if interpolations can get out of sync, but I was able to get around it by constraining the rotation of the thigh using a vector to angle of the foot x position.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Glad you got your problem sorted, @ellfire ; i'm curious to know why you're going to a lot of effort to simulate joints, when animation frames would surely be more straightforward?

    ----------------------------------------------
    http://davidgriffinapps.co.uk/

    iPad: End of the Earth game coming soon to the iTunes App Store....

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • old_kipperold_kipper Member Posts: 1,420
    edited February 2012
    I have had issues with something very similar. I think there might be a timing issue with interpolate clipping into each other. I would drop the first and second interpolates to just under a second and then fire them from timers at second.
  • CloudsClouds Member Posts: 1,599
    Interpolate = very dodgy !

    8-X

    Interpolate has no values between 9.0 and 1, you can have 6.786 and 4.356 and (a personal favourite) 8.673 . . . . . But go above 9.0 and interpolate jumps straight to 1 !

    After that it's fine.

  • ellfireellfire Member Posts: 187
    @gyroscope - I was originally heading down that path, but as I got into it, I for some reason thought that this kind of setup would be less RAM intensive then loading the larger animated sprite. I assume that I was wrong there.

    @Tynan - Wow, never knew that. Seems like quite a problem wouldn't you think?
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @ellfire

    "Wow, never knew that. Seems like quite a problem wouldn't you think?"

    Yep, see this thread: http://forums.gamesalad.com/discussion/39504/how-do-i-make-fade-out#Item_25

    Not sure if it's the root of your problem, might be involved ?
  • ellfireellfire Member Posts: 187
    @Tynan - Don't think this would have helped me, but it will come in handy for some other things I noticed. Thanks for the link.
  • CloudsClouds Member Posts: 1,599
    @ellfire

    "Don't think this would have helped me""

    Rather than helping you with your animation it was posted as a possible cause for the loss of sync over time.
  • ellfireellfire Member Posts: 187
    @Tynan "Rather than helping you with your animation it was posted as a possible cause for the loss of sync over time."

    Oh, no, I understand that, I was only referring that, in this particular case, I'm not sure if it was having an affect on things as my values were always above 1. It is an interesting phenomena though as far as how interpolate works.
  • CloudsClouds Member Posts: 1,599
    "I understand that, I was only referring that, in this particular case, I'm not sure if it was having an affect on things as my values were always above 1"

    Ah! Understood.

    "It is an interesting phenomena though as far as how interpolate works."

    Yep, it explains a few little glitches in Gamesalad (fades / volume changes / moves etc) - being aware of it also means you can solve these annoying issues fairly easily.
Sign In or Register to comment.