Smooth Actor Motion

johnnyk022181

  • Posts: 96
Nevermind.. I found the blocks.. Thank you!  I will let you know if it works well for me.. 

johnnyk022181

  • Posts: 96
What would be the best way to implement this code if i'm moving my actor with Arrow Keys on the Keyboard? 

rob1221

  • *
  • Posts: 9424
Just adjust the numbers and see what works best for your game.

johnnyk022181

  • Posts: 96
The problem I have is in Internet Explorer.  When I move it seems to drag or sometimes move more than what it should...  This only happens with IE..  It works fine in Firefox, Chrome, and Safari..  This was my last resort, and i'm still having the same issue..  :-/  Thank you for your posts..

Almakos

  • Posts: 632
some kind of dark sorcery but works really well on desktop and mobile =)
thank you!
Fishing Fantasy Trailer


1MrPaul1

  • *
  • Posts: 1268
in flash it is fine, on android little better than without it, but on windows it is not working at all. I tried to set up different values, but actors always moving jerky in the same way as actors without enabled smooth motion.

rob1221

  • *
  • Posts: 9424
I saw that problem as well and mentioned it in the jitter thread, but it seems to be a different cause, and I don't know the solution.

1MrPaul1

  • *
  • Posts: 1268
May be you can try again?
Desktop builds works with good performance but this jitters spoiling everything.
Especially in runners it is very noticeable 

luismp

  • Posts: 219
Rob, could you rebuild this extension to work with the new iOS 64 bit support please???
I havent tested it yet but i think it has to be rebuilt to work with the latest version , am i wrong? 

rob1221

  • *
  • Posts: 9424
That applies only to iOS native extensions.  This is a pure Haxe extension.

luismp

  • Posts: 219
Hi, i've using this extension for a while but i have doubts about what is the best configuration, usually im using : 0.2 (move multiplier, 1 (min move), 9999(max move)  and i dont use the position snapping block because i dont really know how it works... @Rob1221 or someone with experience in this extension, can you tell some examples of configurations that are working ok for you??? in my games actors are still jittering sometimes and im just wondering if there is a better configuration...

thanks in advance

rob1221

  • *
  • Posts: 9424
That looks fine, although it's been a while since I used this extension.  Keep in mind that this extension only helps one of the sources of jitter.  The others are unknown and unsolved.

luismp

  • Posts: 219
first of all, thank you very much rob, you are always very helpfull . I thought that the jittering was solved a while ago with your extension so i was assuming that my numbers werent correct ...do you know if the jittering is still being investigated or is something we have to live with until "magically" it disappears???

rob1221

  • *
  • Posts: 9424
It isn't being looked at because no one knows where to look.

Jon

  • *
  • Posts: 17524
Abiblablobla posted this a few weeks ago. It may be of interest if you're experiencing jitter and are curious about any hacks that may alleviate it. I'm skeptical about the change because it doesn't make much sense that adding more to draw would fix the issue.

I think I found what is causing this jerky movement. It seems like openFL struggles to render the whole screen when transitionLayer has no children. When there is a transition, transitionLayer has at least a child which covers the entire screen and the game runs smooth, but when the transition is complete, all the children are removed from transitionLayer and the game starts to jerk.

I also found a workaround. I am just adding a child to transitionLayer before adding transitionLayer to the root layer like this:
Code: [Select]
// Engine.hx
// Line 727
        transitionLayer = new Sprite();
// Adding these six lines seems to solve the issue
        var testRect = new Shape();
        var testRectG = testRect.graphics;
        testRectG.beginFill(0xff000000, 0.01);
        testRectG.drawRect(0, 0, Engine.screenWidth * Engine.SCALE, Engine.screenHeight * Engine.SCALE);
        testRectG.endFill();
        transitionLayer.addChild(testRect);
// Line 728
        root.addChild(transitionLayer);

If the alpha value of the rect is 0, this workaround doesn't work.
The rect has to cover the entire height of the screen. If the rect height is smaller than the screen height the game runs smooth where the rect is drawn, but is jerky elsewhere (I hope this sentence makes sense).