Page 1 of 1

activeNextPlayer() includes eliminated players

Posted: 09 November 2018, 01:18
by quietmint
I suspect https://en.boardgamearena.com/#!bug?id=11368 is a BGA framework bug. It appears $this->activeNextPlayer() does not check for player elimination. In game https://en.boardgamearena.com/#!gamerev ... e=45466119 player adamjthompson00 is eliminated @ move 8. The system sets him to be the active player @ end of move 17, which triggers the bug. Why was he made active again?

If a player is eliminated, the framework should never make him active under any circumstance. All of these functions need to ignore eliminated players:
  • $this->activeNextPlayer()
  • $this->activePrevPlayer()
  • $this->gamestate->changeActivePlayer( $player_id )
  • $this->gamestate->setAllPlayersMultiactive()
  • $this->gamestate->setAllPlayersNonMultiactive( $next_state )
  • $this->gamestate->setPlayersMultiactive( $players, $next_state, $bExclusive = false )
  • $this->gamestate->setPlayerNonMultiactive( $player_id, $next_state )

Re: activeNextPlayer() includes eliminated players

Posted: 09 November 2018, 09:41
by A-dam
Hi, in my game, it works as intended...

Re: activeNextPlayer() includes eliminated players

Posted: 12 November 2018, 07:30
by quietmint
I've gotten three reports from users and I can reliably reproduce this in studio, so it's definitely a BGA bug. I added log lines printing the current player immediately after calling activeNextPlayer() and I can prove eliminated players are being set to active.
Start of game
ACTIVE NEXT PLAYER: quietmint0 / 2305326 is active and eliminated = 0
quietmint0 places a tile with jungle and clearing on level 1.
quietmint0 builds 1 hut on clearing.

ACTIVE NEXT PLAYER: quietmint2 / 2305328 is active and eliminated = 0
quietmint2 places a tile with jungle and sand on level 1.
quietmint2 builds 1 hut on jungle.

ACTIVE NEXT PLAYER: quietmint1 / 2305327 is active and eliminated = 0
quietmint1 places a tile with jungle and sand on level 2.
quietmint1 cannot build and is eliminated!
quietmint1 has been eliminated from the game.

ACTIVE NEXT PLAYER: quietmint0 / 2305326 is active and eliminated = 0
quietmint0 places a tile with lake and sand on level 1.
quietmint0 builds 2 huts on sand.

ACTIVE NEXT PLAYER: quietmint2 / 2305328 is active and eliminated = 0
quietmint2 places a tile with lake and rock on level 1.
quietmint2 builds 2 huts on jungle.

ACTIVE NEXT PLAYER: quietmint1 / 2305327 is active and eliminated = 1
Game over! No tiles remain.
End of game
---

For now I have added a workaround to my game (query player table and call activeNextPlayer() again if the active player is eliminated), but I still believe BGA framework should fix this bug.