Trouble with Actors wiggling when they should be stationary

Hi everyone, I found this thread from almost a year ago http://forums.gamesalad.com/discussion/comment/358833#Comment_358833

The one solution suggested by a link doesn't work anymore @jamie_c

So seeing that this happened then and is still happening, surely there must be a way to address this. I've tried to the best of my knowledge all of the suggestions in that thread with no luck or change in behavior at all.

This is a really serious bug when dealing with numerous objects on screen all jiggling on their own uncontrollably. It is going to make it difficult to make this game as it should be when such basic bug occurs.

Thanks!
Caleb

Best Answers

  • RThurmanRThurman Posts: 2,880
    Accepted Answer
    @part12studios
    The missing video from @jamie_c showed how to put these rules in the "otherwise" section of a collision rule:
    Change Attribute:self.selfX To: self.Position.X
    Constrain Attribute: self.Position.X To: selfX
    Change Attribute: self.selfY To; self.Position.Y
    Constrain Attribute: self.Position.Y To: selfY

    But I don't particularly like using constrains (which can bog things down).

    Another way to do it is to stop the linear velocity with a timer. (Because, for me, it seems that the linear velocity has a residual effect that does not get completely turned off before it moves on to the next behavior.) So I do something like:
    Change Attribute: self.Linear Velocity.X To: 0
    Change Attribute: self.Linear Velocity.Y To: 0
    Timer ( For .1 seconds)
    --Change Attribute: self.Linear Velocity.X To: 0
    --Change Attribute: self.Linear Velocity.Y To: 0
  • ericzingelerericzingeler Posts: 334
    Accepted Answer
    @part12studios

    FYI: I saw your other post and couldn't reply because it was a pro thread.

    Try this:

    Move behavior with:

    Move Type: stacked
    Speed: 0

    You can throw this inside a rule when magnitude(motion.x,motion.y) is less than some number.
  • ericzingelerericzingeler Posts: 334
    edited August 2013 Accepted Answer
    @part12studios

    Ok, I've done some digging around and I'm thinking it's related to the engine's drag function. Although it only appears to happen when more than 1 actor is in the scene.

    Check out this project for a demo.

    Inside the move actor there is a function that (once actor is under a specified speed) will gradually make the actor stop by using some basic drag math. Once the actor has stopped, the drag function quits.



  • ericzingelerericzingeler Posts: 334
    edited August 2013 Accepted Answer
    Also wanted to point out why my second solution would be a better option. Using the move stacked although less work, can cause some unwanted behaviors.

    For example:

    You have an actor with a rule that when under a speed of 5, move (stacked) to 0.

    Now let's say that actor is traveling perpendicular to a wall and collides with it, then bounces off heading in the exact opposite direction. In theory, at some point after the bounce the actor speed would be equal to zero, thus qualifying the move rule and interrupting the intended path from bouncing off the wall.

    The second solution (if math is correct) would never interfere with the intended path, but always does its job of stopping the actor at the end.

Answers

  • VolontaArtsVolontaArts Member Posts: 510
    i too am experiencing this problem. if i find a way to fix it i will let you know.
  • part12studiospart12studios Member Posts: 620
    edited August 2013
    https://www.dropbox.com/s/yq3czjjvrgd63hs/jiggle problem.mov here is a video to show what i am talking about. initially when any object is spawned or an object placed on the stage manually the objects are rock solid.. as soon as any contact either directly by player or other objects begins to create this jiggling velocity problem.

    So far as I can tell when i put a display text the linear velocity x and y display their values which begin to randomly jump around.. too fast to give specfiic highs and lows.. but i'm thinking i see something between + / - 20...
  • part12studiospart12studios Member Posts: 620
    awesome! Ok i'll try both of those asap! Let you know how it goes. i had some "if under" speed at one point but they are gone now.. will go back to an earlier proof of concept project and test there that still had the wiggle problem
  • part12studiospart12studios Member Posts: 620
    edited August 2013
    @ericzingeler that definitely worked! @RThurman your version looks like it uses constraints. do you think that Eric's suggestion (seeing that it works) would be better since it has no constraints to it? I tried his first since it was the easier of the two. OMG so nice to not see jiggle!

    @BurberryArts give this a shot. I think this is key to this issue! Thank you everyone.. you guys continue to reinforce the truth that GameSalad has THE absolute best community! I've tried other engines and forums and they are never as helpful.

    This is one of the reasons I stay with GameSalad! :) TY!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @ericzingeler that definitely worked! @RThurman your version looks like it uses constraints. do you think that Eric's suggestion (seeing that it works) would be better since it has no constraints to it?
    My recommendation is to always use @ericzingeler's solutions. That' what I do!

    His solution would work because it uses "stacked" instead of "additive" in the move behavior. I keep forgetting that the default "additive" just adds to the already current movement. (So if its moving at '.1' and you add '0' to it -- it is still going to move at .1) But "stacked" means to set it to that exact value. (So if it says '0' -- it means it!)
  • part12studiospart12studios Member Posts: 620
    that's awesome! I've never understood (meaning to do so) what stacked / additive actually meant.. I tend to leave these default and often forget they actually do help with things in certain situations. :)
  • part12studiospart12studios Member Posts: 620
    @ericzingeler wow yea i'm so glad you're rule avoids all of that kind of excess constraints and rules. It's a shame GS itself couldn't just factor in some very tight low level rule. I can't fathom one situation where devs would want that jiggle effect so the argument of overhead it might add doesn't seem like it would be a fair argument to not fix this.
  • RPRP Member Posts: 1,990
    edited August 2013


    "I can't fathom one situation where devs would want that jiggle effect"

    Your actors are telling you something. They want a Twearking game.

Sign In or Register to comment.