Fast-replay skipping stock removes

Game development with Board Game Arena Studio
Post Reply
User avatar
crableybradtree
Posts: 13
Joined: 29 December 2023, 02:05

Fast-replay skipping stock removes

Post by crableybradtree »

I am having a problem when doing a fast-replay of a game (Livingstone, Alpha). Only during fast-replay, some of the removeFromStockById() in a notification (notif_soldGem) don't occur. No errors are reported and each stock item has a unique ID. The game works fine real-time. turn-based or step-by-step replay.

How the game works:
- player gets X number of times to randomly draw a stone.
- player clicks on a "bag" icon to randomly draw one stone. The notif_stoneDug() is called to display that token in the "stonesPulled" stock.
- if player has drawn the last stone, all drawn stones are then moved on the screen from the "stonesPulled" stock to the "gemsInHand" stock.
- the player may then immediately click on items in the "gemsInHand" stock one at a time to sell them, which results in notif_soldGem() removing the gem from the "gemsInHand" stock.

It is usually the first removeFromStockById() in notif_soldGem() that gets skipped after all the items are moved from the one stock to the other in notif_stoneDug().

Is the fact that I have the await and/or made notif_stoneDug() async maybe an issue for fast-replay? Do I need to do any work to handle animations done by stock calls during fast-replay or is that handled within stock?

Pseudo-Code snippets:

Code: Select all

notif_stoneDug : async function(notif) {
  this.stonesPulled.addToStockWithId(this.stoneStockIndex.get(stoneColorName),stoneId);
  if (lastStoneDug) {
    await this.wait(2000); // delay so player can see last stone dug
    for (var pulledStoneId in pulledStones) {
      this.gemsInHand.addToStockWithId(stoneType,stoneId,pulledItemDivId);
      this.stonesPulled.removeFromStockById(stoneId);
    }
  }
}			

notif_soldGem : function(notif) {
  this.gemsInHand.removeFromStockById(notif.args.stone_id);
}
User avatar
yannsnow
Posts: 15
Joined: 12 December 2016, 12:47

Re: Fast-replay skipping stock removes

Post by yannsnow »

I confirm they are several bug in stock related to fast-replay.
I had already sent months ago to Thoun what to correct in updateDisplay. Thanks to your bug found i have now also send what to correct in _removeFromStockItemInPosition.
The only problems is that they are very slow to correct bugs, I have already communicate what to change since months and it is not yet corrected
i have now created a bug report https://boardgamearena.com/bug?id=152887
User avatar
crableybradtree
Posts: 13
Joined: 29 December 2023, 02:05

Re: Fast-replay skipping stock removes

Post by crableybradtree »

Thanks for the reply and confirming that it's possibly not just my boo-boo. I'm not overly worried about fast-replay as long as regular replay (for tutorials) and the game itself works properly, so I may just leave that as a "known issue" as I move into beta.
Post Reply

Return to “Developers”