[solved] "action in progress" and stuttering animations

Game development with Board Game Arena Studio
Post Reply
User avatar
Coin-coin le Canapin
Posts: 163
Joined: 31 January 2013, 19:00

[solved] "action in progress" and stuttering animations

Post 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 ?
Last edited by Coin-coin le Canapin on 20 August 2015, 13:53, edited 1 time in total.
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

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

Post 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?
}
User avatar
Coin-coin le Canapin
Posts: 163
Joined: 31 January 2013, 19:00

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

Post 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 ?
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

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

Post 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.
User avatar
Coin-coin le Canapin
Posts: 163
Joined: 31 January 2013, 19:00

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

Post by Coin-coin le Canapin »

Both animations stutters on my computer and I don't have any clue why.
User avatar
Coin-coin le Canapin
Posts: 163
Joined: 31 January 2013, 19:00

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

Post 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.
Post Reply

Return to “Developers”