Sim Posted June 14, 2020 Share Posted June 14, 2020 I have a little issue with my item System. Once a player owns an item, it's in there inventory, a player can LIST on personal shop Public Shop List it for trade Equip Item As of now, any item can be listed for sale in there personal shop, public Shop and listed for trade. Do people believe a item can only be listed in one place or multiple places? Quote Link to comment Share on other sites More sharing options...
Spydre452 Posted June 14, 2020 Share Posted June 14, 2020 Thats a good question sim, unless its made to remove from all other markets if purchased in one market, I think that maybe beneficial in some areas - but I think it would help if the listing was detailed to say its listed elsewhere, maybe? Struggling to work out which way would work best really. Is a good question 1 Quote Link to comment Share on other sites More sharing options...
Veramys Posted June 15, 2020 Share Posted June 15, 2020 If they have more than one quantity of an item and list in multiple places at once that's fine. But an (item x quantity) should be removed from the inventory as soon as it is listed and stored in whichever database for whichever market using the userid of the lister. It should not remain in the inventory, that's just too much trouble. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted June 15, 2020 Share Posted June 15, 2020 Could add checkboxes to your creation form, along with relevant columns to the items table - select, on item creation, where the item can be listed (if at all) Quote Link to comment Share on other sites More sharing options...
Sim Posted June 15, 2020 Author Share Posted June 15, 2020 (edited) I could @Magictallguy but I wont. The only option I may ever add is if an item can ever be resold. But I am asking for people's opinions about what there preference is as a game owner on this situation. I agree with @Veramis . Coding wise, I wouldn't remove the item from inventory though, I would just create another column inUse. And either make it Boolean, or specify it's location(equiped, trade, user shop, black market). Edited June 15, 2020 by Sim Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted June 15, 2020 Share Posted June 15, 2020 What about higher quantities? Your idea of setting a bool directly on inventory would work for single items, but quantities would be much harder to handle Quote Link to comment Share on other sites More sharing options...
Sim Posted June 15, 2020 Author Share Posted June 15, 2020 1 hour ago, Magictallguy said: What about higher quantities? Your idea of setting a bool directly on inventory would work for single items, but quantities would be much harder to handle Nope, I have every item stored in the inventory, if they own 10 wooden knifes, there's 10 instances of wooden knives in the table. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted June 15, 2020 Share Posted June 15, 2020 Ah, I see. Thinking scalability now; a simple boolean flag for "in use" is fine if you only have 1 non-standard use for an item. But what if, in the future, you decide to add something else that could also make use of the "in use" boolean? I can see that getting confusing to manage and potentially giving unexpected/unwanted results with the conflict. So, to keep with logic, you'd just add another bool, right? How many booleans are you going to be ultimately adding until moving data to a separate table just makes more sense? I'm not knocking your approach, in fact I quite like it. I merely wish to point out a potential flaw to future designs Quote Link to comment Share on other sites More sharing options...
Sim Posted June 16, 2020 Author Share Posted June 16, 2020 2 hours ago, Magictallguy said: Ah, I see. Thinking scalability now; a simple boolean flag for "in use" is fine if you only have 1 non-standard use for an item. But what if, in the future, you decide to add something else that could also make use of the "in use" boolean? I can see that getting confusing to manage and potentially giving unexpected/unwanted results with the conflict. So, to keep with logic, you'd just add another bool, right? How many booleans are you going to be ultimately adding until moving data to a separate table just makes more sense? I'm not knocking your approach, in fact I quite like it. I merely wish to point out a potential flaw to future designs I'm a coder, I'd redesign the whole item System at that point. But could just use inUse as a varchar(10). And if blank, would be false, then could always explode it for different aspects. To start, inUse e be equip, inUse u be userShops, inUse t be trade, ECT. If needed more in future, inUse e:t:u Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted June 16, 2020 Share Posted June 16, 2020 3 hours ago, Sim said: If needed more in future, inUse e:t:u Which kinda negates the point of a database. Quote Link to comment Share on other sites More sharing options...
Sim Posted June 16, 2020 Author Share Posted June 16, 2020 1 hour ago, Magictallguy said: Which kinda negates the point of a database. I don't see me ever needing anything more then just returning a simple varchar(1) ever so I'm not worried about it. If the time ever comes, another field is always an option to. Today I see many seperators : or - in DB fields which I'm mostly opposed to. But I'm not sure if it would negate a DB since the a database is actually just organized text. Seperators: can still have SQL queries ran on them. LIKE %:e:% Quote Link to comment Share on other sites More sharing options...
ags_cs4 Posted June 16, 2020 Share Posted June 16, 2020 (edited) not sure i get what you both talking about 😄 but here what i made, if the user use the item it get removed from inv(added to userstats equipment column), if its in user shop it get removed to and added as a new row in DB 8 hours ago, Sim said: if they own 10 wooden knifes, there's 10 instances of wooden knives in the table. sim ur game have 40 player yes that ways is not bad but later with 500+ user even not playing u will have problem with DB, imagin 100 player all having 10 knives wich give us 100 * 10 = 1000 row in DB and this only if they have only knives, say more potions more armors ... thats alot, all ur game revenue will go to the db server Edited June 16, 2020 by ags_cs4 Quote Link to comment Share on other sites More sharing options...
Sim Posted June 16, 2020 Author Share Posted June 16, 2020 3 hours ago, ags_cs4 said: sim ur game have 40 player yes that ways is not bad but later with 500+ user even not playing u will have problem with DB, imagin 100 player all having 10 knives wich give us 100 * 10 = 1000 row in DB and this only if they have only knives, say more potions more armors ... thats alot, all ur game revenue will go to the db server Databases are built for that. There's a reason for every item being listed in the DB. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.