I think that if the game picks up I will eventually do a wholescale interface rehaul with advice from or done by a professional UI artist.
I'm a bit stuck at the moment programming wise.
I have always done my items as individual entries in a database. So:
table_items = id, user_id, item_id
This makes it very easy to use as adding or removing items is as simple as UPDATE and DELETE FROM, while checking the amount can be done with count.
But that means if you have 10,000,000 of an item, which is reasonable to expect in what is basically a RuneScape clone, you end up with both a lot of entries in the database and a lot of processing to do the count.
But I don't know which I should be doing. I could do this:
table_items = id, user_id, item_id, quantity
But then there is still one entry for each individual item_id.
Logically the best way to do it seems to be to store items in the user data table:
user_data = user_id, ..., name, etc, item_1_quantity, item_2_quantity, item_3_quantity
But then each item I add to the game will require me adding a new column, and I'd rather it be dynamic. Not easy to manage items in this way.
So what's the best way to go about this? (Probably just the table_items way above).
I'm trying to think what else I might need to store for each individual item. Perhaps I could store the date it was gained, where it was found, and other data so that the user can look this up, which might be cool? That would mean I'd have to do it the table_items way.
Does mean that I would have to:
TO ADD x OF AN ITEM:
- check if item exists
- - if exists, add one to the quantity
- - else, INSERT with quantity x
TO DELETE AN ITEM
- check if item exists
- - if exists, check the quantity is above 0
- - - if above 0, remove one from the quantity
- - - else return error
- - else return error
- else INSERT with quantity 0 to save processing later
Gah. I have sql sometimes. I wish there was a "DELETE IF EXISTS", "SELECT but INSERT IF NOT EXISTS" etc. Probably is. I should read some stuff.
...and then whichever I go with I am going to have to make a script to replace all the items people have already earned with the new format.
2259 total. Eugh.