I’m currently designing my game’s database – and I’d like it to be as pretty as possible. Below you’ll find some
Database Game {
//The ID of the game (unique)
int id
//First player data
varchar firstPlayerName
int firstPlayerSessionID
varchar firstPlayerIP
//Second player data
varchar secondPlayerName
int secondPlayerSessionID
varchar secondPlayerIP
//The opponent type, 0 is default (against the "computer") while 1 is against another player
int type
//The size of the game, default: 3
int size
}
(Excuse the format, it’s just a mashup intended for myself only)
I’m mainly looking for suggestions on the “Player-part” – I guess it’s okay the way it is right now, but what if there would be more than 5 players? Way to messy if you ask me.
Is there any better way to do it?
Have a separate Players table, and associate the two tables with a third table (Game_Players) based on the ID of the player and the game.