I'm trying to code a dice game where users log in and then challenge each other. I already made a version of this game without login but only one game could be played at a time.
So now, there will be the possibility of several games going on simultaneously between users.
In the non-login version I needed 4 tables for each game, one for the players' names, one for each player's previous scores, and one to store their current throws. They auto updated and cleared as the game progressed.
My idea for the login version is to give each game an id so the first game which is initialized will be game1, the second, game2 etc. and for each game generate the same 4 tables. In each game they will have the same names (player1_subtotal, player2_subtotal for example) but in game 1, each table will have a game_id which identifies it as belonging to game 1, and likewise for game 2 etc.
Just to reiterate, this would mean that there would be several tables with the same name, but each with a different game_id. And there would be several tables with different names, but tied together via the same game_id.