Original Post
Heyas; I'm a guy that is just getting into game development. I have a ton to learn yet, and I have been doing it all on the fly. With that said, let me get to the reason of my post. Currently, I am having trouble in the building of my database, so I thought I'd throw the problem to some of you, in the hopes that someone can make a suggestion that would work. I'm currently working ona sci-fi multiplayer, turn-based strategy game that deals with the 'mecha' genre. If the game does well, I hope to expand upon it, making it an MMO, and introducing empire management, and other cool things. Anyhow, I'm using mysql as the database in which to store all the relevant information for my mechs, but am having trouble. You see, each mech consists of several sections; head, L/R arm, L/R torso, center torso, L/R leg, as well as R/L rear torso, and center rear torso. Each section has an assignment of armor points & internal points. Also, weapons are location specific, so that when a mech loses an arm, the weapons in the arm are also lost. With that foundation established, the problem I am having is getting away from creating duplicate entries, as duplicate entries would quickly make the database grow too quickly. The primary key that I'm using is a code specific to each mech - a 'mech code'. So far, I have the following tables that are relevant building blocks of a mech; weapon table - a list of weapons, their ranges, their damages, etc. mech_armor - armor & internal per section of the mech mech_eq - equipment of the mech, i.e. gyro's, actuators, sensors, ecm, & etc. In the above tables, there weren't any problems in duplicate entries, as each section so far has had one value associated to each section of the mech. The problem begins when I try to assign multiple weapons to each mech section. For example, if i want to add 2 lasers to the left torso. Any way I create this table, I get duplicate entries. As some of you may have guessed, I am just learning MySQL, and I am convinced that there is an easy solution to this problem. Anyone willing to give me a push in the right direction?