Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm interested in the conceptual (programming language agnostic problem) process of sending a game object to another player of the game in exchange for another game object without a face-to-face online presence of both parties. This should be done so that in theory in game exploitation of inherent bugs of the trading system would not be possible to dupe items or steal items from another player. In this case I am not considering cheaters, (I strictly define cheating as manipulating of in game RAM/saves and NOT exploitation of programming/inherent bugs/flaws) only the ability of users to dupe or steal items from strictly within the game itself.

Possible method idea to solve this:

  1. Player 1 (P1) and (P2) meet out of game to arrange a trade of in game loot and come to an agreement amongst themselves.
  2. Both players go in game to set up the trade by giving their item "to the game" to hold and remain inaccessible for the duration of the trade. In exchange they are given a procedurally generated alphanumeric encryption code (such as pokemon mystery dungeon or similar) specific to themselves and the other player's name and ID number (similar to the mainstream pokemon games)
  3. Both players share their codes with each other and enter the opposite code into their game.
  4. a confirmation screen appears for both players showing the other player's offer. if a player accepts the offer they are given another code to give to the other person.
  5. Both players enter in the other's confirmation code to their game and both players receive their item in game.
  6. not sure but may additionally need both players enter in a thank you code to truly confirm both players got their items, but I think that is covered by the confirmation code because if P1 confirms and gets P2's confirm then that means P2 confirmed also. And likewise if P2 confirmed and received P1's confirm then P1 confirmed.

But as I think of it, if P1 accepts and P2 accepts and P1 gives the code but then P2 does not, then P2 is able to get his desired item at the cost of his item and P2 is now a scammer to P1 because P1 was denied his new item, (it vanished) It would cause players to incrementally trade items of lesser worth because they wouldn't stand for losing that great loot they couldn't use but would still be valuable; wasting people's time and discouraging trade. Also a thank you code would add time to the process and not cause any added security. I actually think this is a real world problem of agreements, trading goods, and trust that requires synchronous trade. I think this cannot be solved in a game any more so than in real life. Correct me if I am wrong.

share|improve this question
    
My first instinct is to tell you to look at BitCoin, specifically how the BitCoin block chain works. (en.bitcoin.it/wiki/Block_chain) –  Bjarke Freund-Hansen Feb 11 '13 at 10:46
    
Bitcoin relies on more than two people being present to validate the transaction. –  Eliot Ball Feb 11 '13 at 13:18
    
Thank you for editing my question for formatting and typos, was at home typing on a Wii keyboard into their onscreen keyboard. At any rate, Are you guys saying that there HAS to be a central server in order to trade items between players and that it doesn't make sense without one? Of course maybe that is why specific individual pokemon are not worth any real money to anybody, even if advertised and confirmed as legitimately obtained. because there is no central server validating every pokemon and due to sites like [link](pokecheck.org) duping pokemon data is easy to the average user. –  0xFFF1 Feb 11 '13 at 17:38
    
Sorry, I misunderstood the term "face-to-face online". So you want to achieve this with two offline copies of the game, correct? –  Hand-E-Food Feb 12 '13 at 0:22
    
Yes, in a similar sort of way to how OLD games used to have these codes to write down instead of saving to a file if save files couldn't be written or the required file size was too big for the machine. except ill be programming on a modern machine for modern machines, and just don't want the online requirement and yet still have trading between people who play it. –  0xFFF1 Feb 12 '13 at 16:29

1 Answer 1

escrow
n. A bond, deed, or other document kept in the custody of a third party, taking effect only when a specified condition has been fulfilled.

Let the system (the third party) administer and fulfil the contract. The contract is that two players agree on a set of items to trade. This solution also assume the players are strangers and will never meet in real life.

  1. Alice offers a +1 Sword for sale.
  2. System takes the +1 Sword from Alice.
  3. System advertises the +1 Sword for sale.
  4. Bob makes an offer of 1000 gold.
  5. System takes 1000 gold from Bob.
  6. System alerts Alice of the offer.
  7. Alice counteroffers, requesting 1000 gold and a Healing Potion.
  8. Since the offer was effectively declined, System returns 1000 gold to Bob.
  9. System alerts Bob of the counteroffer.
  10. Bob accepts the counteroffer.

    The contract is fulfilled.

  11. System takes 1000 gold and a Healing Potion from Bob.
  12. System closes the advertisement.
  13. System gives Bob the +1 Sword.
  14. System gives Alice the 1000 gold and Healing Potion.

Or, at any time:

  1. Alice retracts the sale.
  2. System closes the advertisement.
  3. System returns the +1 Sword to Alice.
  4. System returns any held items to Bob (and other players who have made offers.)

With concern to cheaters, you will never stop someone from modifying local save files. The inventory must be replicated on a secure server and validated before any sale takes place. It should also validate before the player uses items. If a player hacks their character to have a +58 Sword of Oblivion, they can acquire wealth a lot faster than honest players. If they sell their ill-gained loot, they can damage the economy.

share|improve this answer
    
"...will never stop someone from modifying local save files" - specifically, the strictly offline requirement implies that all code and signing keys required to generate loot reside on the client, which can be reverse engineered / modified. As a (weak) alternative, I wonder if an audit trail of the circumstances of how each loot item was generated could be kept. At the time of sale, this audit trail would be examined by the server for feasibility, including things like whether the random seed has been tampered with offline (compared with a user's previous sales), etc. –  Daniel B Feb 11 '13 at 6:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.