Jump to content
MakeWebGames

Item Transfers in Item System


Sim

Item transfered.  

4 members have voted

  1. 1. How should item transfers work?

    • One Instance: Any item in use can't be used anywhere else.
      3
    • Multiple Instances: any item can be listed in multiple shops, trades,
      1


Recommended Posts

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?

Link to comment
Share on other sites

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 

  • Thanks 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Sim
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

1 hour ago, Magictallguy said:

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:%

Link to comment
Share on other sites

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 by ags_cs4
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...