question

leonard-hansing avatar image
leonard-hansing asked

Market functionality

I want to implement market functionality into my game where players can buy and sell their items. As far as I can see, PlayFab doesn't support that out of the box.

I would solve it like this currently:

When a player wants to sell an item, he issues a request to cloudscript. There I would remove the item from his iventory and then do a http call to a custom market rest api and add that item to the market.

When a player wants to list items on the market, he can set some filters and make a call to cloudscript. Here I would do some sanity checks again (like is he allowed to query that part of the market etc.). Then call the market api with the filters and return the result to the client.

When a player wants to buy an item, he issues a request to cloudscript. Cloudscript gets that item from the market api, checks the price against the players currency. If theres enough he removes the item from the market, substracts the currency and adds the item to his inventory. Then he adds the price to the sellers currency.

Is that a reasonable setup? And is that possible with the free tier?

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jital avatar image jital ♦ commented ·

Greetings,

Can you provide more information about the "custom market rest api" you mentioned? I would like to know more about this piece. Are you referring to the PlayFab commerce system?

0 Likes 0 ·
leonard-hansing avatar image leonard-hansing jital ♦ commented ·

No I am not referring to the PlayFab commerce system. What I had in mind was a simple database with a table that holds the listed items on the market. Then infront of that there's a rest api with methods to add, remove and get an item and one to query a list of items depending on filter settings. Maybe "auction house" is a better term to describe what i want to achieve.

The goal is that a player can put an unwanted item up for sale or browse for items that he needs.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

No, there isn't a data system currently in the service that would support what you have in mind. The problem is that you need to have a single source of data (the catalog of all items for sale) that can be both read by all players and updated by all players - so, potentially millions of inputs. Please see this thread for a more detailed discussion on this topic:

https://community.playfab.com/questions/22293/often-updated-content-lists-job-for-the-title-data.html

We do have a UGC service in private preview right now. That service does allow players to create and post content, which can be set up with pricing in your title's virtual currencies. It wouldn't be difficult to use that as a way to have a market where players could buy and sell goods as you describe, you simply wouldn't be using that service's ability to host custom content per item.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.