Page 1 of 1

[solved] "action in progress" and stuttering animations

Posted: 30 July 2015, 11:17
by Coin-coin le Canapin
I'm working on a Fanorona adaptation.
When I move a stone successively while waiting about one long, long second between each move, it works well. However, if I click multiple times on the target intersection, it apparently executes an action which will never end. If I then click to move my stone multiple times, the game tells me that an action is already in progress even if I wait seconds before each move.
And if I click on a new available intersection immediately after a move, it generates other errors.

/!\ All these errors disappear if I remove this line from my .js :

Code: Select all

if(!this.checkAction('moveStone')) { return false; }
I still check for the state server side on my .game.php.
Any idea where does this issue come from ?

Is it useful to keep this checkaction in my .js even if we have a lock: true in the following ajax call and a server side check action ?

I also have another issue. The moves are very slow : about 200ms between the click and the beginning of the animation (when the move is recorded I guess). That could come from my internet connection as I live in the far campaign (unstable 200 KBs), but how can I be sure ?
Plus, the animation itself of the sliding stone is stuttering. It should be smooth… Any idea about that ? I thought it could be because of other CSS animations happening at the same time like the scrolling log elements, but I hid them and the animation was still stuttering even if it was the only animation on the screen.

Here is my related .js function : http://pastebin.com/ynSN6uyH
my PHP action : http://pastebin.com/tCpq0pUX
my PHP action function : http://pastebin.com/5kcCCuPk
my used utility functions : http://pastebin.com/0uxSMG1c

Is there anything I do wrong that could cause these different issues ?

Re: "an action is already in progress" and stuttering animat

Posted: 05 August 2015, 15:02
by Rudolf
Are you sure you don't need a "reentrancy" flag, to be sure you don"t execute several times the animations ... then count of timers explodes and this delays all your animations?

entrance = 0;
function Onclick ....
{
if(entrance) return;
entrance = 1;
.... to be sure we cannot click again till action is finished
...
}

function RevalidateClick
{
entrance =0;
when you sure you can click on?
}

Re: "an action is already in progress" and stuttering animat

Posted: 19 August 2015, 19:09
by Coin-coin le Canapin
Hi :)
I fixed the never ending action.

However the animations are still stuttering a lot.

Can someone try Fanorona and tell me if there is the same issue on its computer ?

Re: "an action is already in progress" and stuttering animat

Posted: 19 August 2015, 22:57
by pikiou
The animation of the stone you move works (a bit fast to my taste, but it works).
The animation of the stones you eliminate is indeed stuttering a lot.

Re: "an action is already in progress" and stuttering animat

Posted: 19 August 2015, 23:06
by Coin-coin le Canapin
Both animations stutters on my computer and I don't have any clue why.

Re: "an action is already in progress" and stuttering animat

Posted: 20 August 2015, 13:54
by Coin-coin le Canapin
I fixed the issue.

Dojo slide and CSS transition property don't like each other, that's good to know.