Answer the question
In order to leave comments, you need to log in
How to create a database for players in an online game?
Hello, tell me how to create a database for game users and store inventory there, user location, etc. I imagine it like this:
1. User registration
2. A database is created in which there are tables (inventory, class information, for example, etc.),
but I have a feeling that if I want to get information about users, then I I'll hang for a long time.
And even after registration, his ID will be contained in the database, where there will be a description of all items in the game, etc.
In fact, it turns out 2 databases (one describes objects, the location of NPCs, etc., and also records new users)
To solve the problem, I use PostgreSQL.
Answer the question
In order to leave comments, you need to log in
The question is of course porridge, but let's try:
1) No two databases are needed
2) A table is created for users, for example Users, in which mail, password hash, name, etc. are stored, that is, information about the account
3) For game characters, it is created separate table for example Heroes. In it, already store information about the character of the game and the user_id field, so that it is clear which user the character belongs to.
4) All other tables like Inventory etc should refer to the Heroes table and store the hero_id.
5) Profit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question