I am working on a new game project idea and would like any advice on storing the data for best performance.
Each board (about 70 different areas available to the player) will have its own unique play area. Some will have 9 slots of data and image ids with others having up to 30 slots for the player to click. I need to be able to track each slot that has been clicked and what game piece is uncovered for that click as well as previous clicks. Player will have to match three of the nine items and play will end when a match has been competed.
My question is which would be the best way to store the data in the database.
Example 1;
Game Table
| gameid | slots | slot1id | slot2id | level | last used |
Slot Table
| slotid | image | value |
Play table
this one holds the clicked items and non clicked and requires inserts for each slot each game. (up to 30 inserts for each game)
| playerid | gameid | slot | image | value | clicked | game complete |
Example 2;
Game Table
| gameid | slots | slot_1_image | slot_1_value | slot_2_image | slot_2_value | level required| last used |
Play table
Would only require 1 insert for each game
| playerid | gameid | slot_1_clicked | slot_2_clicked | slot_3_clicked | slot_4_clicked | game complete |
I would also be willing to consider any other advice on different solutions.
Thanks for any help you can offer.