Jump to content

database design advice/discussion


devkn

Recommended Posts

Hi there.

 

I, not unlike many other new users of this forum.... Am building a php/MySQL text-based MMORPG.  It's a bit over my head, which I don't mind.  The problem I'm running into is repeatedly second guessing myself on database design.  I don't want anyone to do my work for me, but a discussion would be great. 

 

I can't seem to find any good info on the pro's and cons of different ways to break up my tables.  At this point I'm still working on the storage of player info, and I think I've already broken it down too much....

 

I've broken down classifacations by logical grouping, as well as which need to be read more, and which need to be written more...

 

This is what I have...

 

Table players, stores basic player info, and things that always need to be known, name, status, gang affiliation, online flags, stuff like that.  Mostly high-reads:

 

|  p_id | name | level | state_code | location_code | status_code | gender | gang | avail | online |

 

most of these are tinyint(1)'s or binary's

 

 

table p_health, holds the attributes that recharge a bit every 5 minutes, I also threw experience in here, I think that was dumb, but xp is a high-write too...

 

| p_id | energy | nerve | awake | max_energy | max_nerve | max_hp | max_awake |

 

table p_updated, a table that holds datetimes for the last time stats were updated, in order to see if they need to be recharged, and by howmuch, and temporary states, like the hospital and jail, and drugs, all of which timeout eventually

 

| p_id | energy | nerve | hp | awake | online | drugs | hospital | jail |

 

table p_stats, holds the players stats... only written to when training, in which case they are high-write, otherwise, high-read...

 

| p_id | str | spd | def |

 

 

 

table p_security, holds info for login and personal details, as well as ip address to prevent multi-accounts...

 

| p_id | login | email | pass | reg_ip | last_ip | pw_hash | pw_hash_salt | cur_salt | cur_salt_ expire | pw_reset_req | pw_reset_confirm |

 

 

 

When I decided to do this, I set my goal, to clone a game I already play, then move on from there. 

 

 

So, after all of that typing!  hahaha!  My question is "am I on the right track?"

 

Am I going nuts over here?  I'm going to wind up with 90 tables at this rate!  I'd like this thing to scale, and be extensible, that's the other major goal.  But I can't really find good info for this type of setup.  So any comments, negative or positive, are very welcome.

 

Arguments on pro's and con's are even more welcome.

 

Oh yeah, and thanks!

 

 

 

 

 

 

Link to comment
Share on other sites

You seem to be pretty well on the right track. Its not uncommon to have alot of tables if a database is designed properly.

 

Theres a pretty good chapter on database normalization in the free book in my sig. Just look in the database section.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.