Create a fake zombie player

Game development with Board Game Arena Studio
Post Reply
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

Create a fake zombie player

Post by Ralchimist »

Hi!

I'm working on Mahjong.
The 3 players version is a 4 players version with a dead player.
Because the dead player is doing same actions than my ZombieTurn function, I'm wondering if it will be a good way to create a fake 4th player and make him as a zombie.
Or is there a better way to do it?

Thanks for answers and advices =)

First edit: when I had a player on the DB, it's worked but I have this error on the top of window "WARNING: the number of players at this table (4) is not coherent with the number of players as known by BGA (3). We recommend you to abandon this table and report this as a bug!"...
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: Create a fake zombie player

Post by Draasill »

I really don't think you can do this, as a zombie player will trigger other things (abandoned game, etc).

But if you "zombie" actions are well wrapped in your code, it should be feasible to use them by a "virtual" player ?
User avatar
quietmint
Posts: 299
Joined: 31 July 2017, 00:28

Re: Create a fake zombie player

Post by quietmint »

I also have a need to do this, and also ran into the same issues about the warning message (as well as an annoying PHP Notice because of some undefined variable in game.view.php line 1031). I'm developing a cooperative game where all the humans play against a single AI. I want to add a row in my players table for the AI player (because I must store the same attributes for the AI as for other players, and because I must display a player panel for the AI). I hadn't thought of making the AI player a zombie, but that doesn't sound like it would work (you'd need to differentiate the AI zombie from human zombies, but I don't think it's possible to access active player ID inside the zombie code). An eliminated player may be better than a zombie player, but it still gets activated in turn order and won't trigger zombie code, but that doesn't solve the root issue about unable to insert fake rows in player table.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Create a fake zombie player

Post by Een »

Well, yes, the player table is ceated by framework, with lots of implications about handling everything.
Inserting fake rows into the player table is definitely something not anticipated and not supported in the current state of the framework.
Post Reply

Return to “Developers”