Page 1 of 1

Game replay hangs when forwarding to move

Posted: 19 December 2021, 12:24
by Alex_tgiu
Hello,

I put this issue already on the discord channel, but due to its messages short liveness I didn't get any solutions, so I'll try here again:

When I replay a match of my game "Bao la Kiswahili" and then forward to a specific move (regular forwarding - fast forward does not work at all, I don't know why), it will start and show some moves and at one point (always differently) it will hang with displaying "No more comments" and "Game situation is updated":
https://imgur.com/a/3DJU0Ru
I then can click next move and will show that and if I do a forward again, the same behavior will appear.

One thing which might be related: Several moves of the player can be executed in a notification and the animation chain for that can last for quite some time (>10s). I do have a wait time at the end:

Code: Select all

this.notifqueue.setSynchronousDuration(anim.duration + 500);
And there is an onEnd method kicking in after that for updating labels:

Code: Select all

dojo.connect(anim, "onEnd", () => { ... }
Another problem may also be related: It rarely happens in a live game (e.g. when switching a browser tab while the move is displayed), that at the end of the move, the game situation is displayed wrongly, so the number labes don't fit the shown seeds. Since this happens in the onEnd callback method above, it may be the same thing.

I have no idea what happens here and how I could change that. I'm very happy for suggestions or a review!

Thanks,
Alex

Re: Game replay hangs when forwarding to move

Posted: 20 December 2021, 17:12
by Shazzypaz
I had some similar issues in my game (nearing alpha) when notifications were an inactive browser tab. Check your animation timings, and consider modifying your code to be more "defensive". In my case, the issue was cards hadn't yet reached destination A, so couldn't be animated from destination A to B. Besides adjusting the timing I tightened up my code so that if the card is expected to be in position A but isn't found (maybe the browser is busy and slow), that the object is placed in destination B and removed from wherever is might be (where it no longer belongs).

Re: Game replay hangs when forwarding to move

Posted: 20 December 2021, 21:58
by Alex_tgiu
Shazzypaz wrote: 20 December 2021, 17:12 Check your animation timings
What exactly do you mean by that?
So my animation works like that: A full move of a player, which gets notified to all players, consists of many single animations. Each animation is of this type:

Code: Select all

this.slideToObject(stone, 'circle_' + player + '_' + field, 333);
They are combined, if objects move together or pushed into an array and then chained.
At the end it is connected with an onEnd-function and finally played and synchronized as shown above.
Shazzypaz wrote: 20 December 2021, 17:12 and consider modifying your code to be more "defensive".
I address each object via id, so I don't expect it to be somewhere.

But what puzzles me more than the problem with notifications in tabs, which might be a rare case, is what I showed in the screenshots: What causes the "No more comments" output and the stop in forward? And what could cause that fast forward does not work at all, not even a single move?

Re: Game replay hangs when forwarding to move

Posted: 21 December 2021, 04:29
by Shazzypaz
Don't know if this is related to your fast forward issues, but I was able to get in-game replay to fail pretty easily. There was a stack trace in the console:

dojo.js:formatted:2850 Uncaught TypeError: Cannot read properties of null (reading 'ownerDocument')
at Object.o.position (dojo.js:formatted:2850)
at Object.slideToObject (ly_studio.js:1)
at Object.notif_moveStones (baolakiswahili.js:formatted:412)
at r.<anonymous> (dojo.js:formatted:1349)
at r.a [as onmoveStones] (dojo.js:formatted:2540)
at Function.o.emit (dojo.js:formatted:2308)
at Function.o.emit (dojo.js:formatted:2339)
at r.emit (dojo.js:formatted:2515)
at Object.publish (dojo.js:formatted:2491)
at Object.publish (dojo.js:formatted:2136)

I poked around in the code since I didn't plan to finish the game and the replay wouldn't be available. The move sequence was:

emptyopponent_4
moveActive_1
emptyActive_1
moveActive_2
moveActive_3

Looked like this code

var stone = movingStones.splice(0, 1)[0];
var stones = circles.get('circle_' + player + '_' + field);
stones.push(stone);

was resulting in undefined set to the stone variable, which then got put into the circles map, and later resulted in an 'undefined' first parameter to slideToObject().

Re: Game replay hangs when forwarding to move

Posted: 21 December 2021, 04:31
by Shazzypaz
Also you're missing a "var" here:

// update bowl labels
board = notif.args.board;

Re: Game replay hangs when forwarding to move

Posted: 21 December 2021, 11:29
by Alex_tgiu
Shazzypaz wrote: 21 December 2021, 04:29 Don't know if this is related to your fast forward issues, but I was able to get in-game replay to fail pretty easily. There was a stack trace in the console:
Thanks for pointing that out, I'll investigate that!