I have the following objects and respective attributes in my unity3d game:
Lumbermill
Quarry
Claypit
My question is, how should I organize this on my Mysql database?
I thought already of:
making a unique table named Buildings and placing all attributes as a column, also with a user_id that refers to the respective user
making a table for each Building with the respective attributes, all of them with a user_id too.
I didn't learn about database in my college yet, so I would really appreciate any help. My English is not one of the best, but I tried to make myself as clear as possible.
Thanks for now :)
You can make 2 tables
Category
id
name
objects
category_id
Level
Production
MaxCap
StoneUpPrice(can be null for non relevant category)
ClayUpPrice(can be null for non relevant category)
WoodUpprice(can be null for non relevant category)
EDIT prior to your comment
You can make seperate bridge table like player_object like below
player_object
player_id
object_id
Assuming you have players table like below
players
id
name
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.