One thing for me that's challenging is understanding what is happening in the BGA Studio framework outside of my code.
I'm basically writing plug-ins and call-backs, but the main program is BGA Studio, and despite the pretty good doc I don't fully understand what happens exactly when in the flow. I know that early in the setup, the database is created. Then the tables I define in dbmodel.sql are created. After that I can use dbQuery and perform inserts to set up the data for the game. But exactly when I should do what is still a little murky to me.
Recently I saw a similar database error when I tried to add a deck to my game. I found I had to add the deck in the constructor, and I had to do the initialization of the deck in setupNewGame. I couldn't do both in the constructor, and I couldn't do both in setupNewGame. I had to split the code. I think the database and tables are created after the constructor and before setupNewGame. I'm not sure how I can verify that though.
I also follow the posted advice of keeping the template setupNewGame as much as possible, and just calling an extra function initTables from setupNewGame to do the table setup and other initialization. This gives better debugging messages. An error in setupNewGame itself throws a message that isn't very descriptive.
Maybe you are running into a timing issue that is related to when some part of your code is executing. Perhaps you have something in the constructor that belongs in setupNewGame/initTables instead.
Since it only happens with some users, perhaps they are doing something different: choosing a different game option? number of players? preferred language?
Do the same people always get the same error, or is it only sometimes for those people?
Please let us know what you find out on this. Happy hunting!
Brian