N
N
nevatas2015-03-04 14:42:15
PHP
nevatas, 2015-03-04 14:42:15

Is everything ok in my database?

Hello, I am a graphic designer by profession, I decided to expand my horizons a little and learn php / mysql. In order to learn by doing, I set myself the task of developing a complete technical clone of a mobile browser game (ahero.ru). And already at the stage of designing the database, there was a feeling that I was doing something wrong.
I will briefly outline the essence of my database:
Users play the game (table: users), each user has several characters (table: userchars), there are 12 of them in the game (table: chars), characters open as the game progresses. At any time, there can be no more than three characters in a user's squad (a squad is active characters directly participating in battles. The active field in the userchars table is responsible for finding an open character in a squad).
Each user has his own inventory (useritems table), items from which can be worn on the user's characters (charitems table is responsible for the items worn on the character. There are 4 types of items in the game - helmet, weapon, amulet and ring, i.e. on character can be equipped with a maximum of 4 items of different types.). The items table is the "base" of all items available in the game.
The items and chars tables are static.
3c1c793acabf4b3e8c567c5537091ac2.png
You can visually see all this action by clicking on the link .
And in general - a question: whether the given part of a DB is normally designed? Mainly because of the relation items - useritems - charitems I don't feel comfortable.
Thanks in advance :)
PS: Sorry for the data types of the table fields (it’s more convenient for me), and for the lack of visual one-to-many relationships (I designed it in navicat, and there is some kind of problem with relationships. There is only one-to-one)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Loligan, 2015-03-04
@Loligan

Where "Items" I understand there are many items. Where is the essence of the subject? And then in "Items" you get only one item, not inventory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question