Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9255709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:46:19+00:00 2026-06-18T11:46:19+00:00

I am trying to implement a 2-player turn-based game with a GAE backend. The

  • 0

I am trying to implement a 2-player turn-based game with a GAE backend. The first thing this game requires is a very simple match making system that operates like this:

  1. User A asks the backend for a match. The back ends tells him to come back later
  2. User B asks the backend for a match. He will be matched with A.
  3. User C asks the backend for a match. The back ends tells him to come back later
  4. User D asks the backend for a match. He will be matched with C.
  5. and so on…

(edit: my assumption is that if I can figure this one out, most other operation i a turn based game can use the same implementation)

This can be done quite easily in Apple Gamecenter and Xbox Live, however I would rather implement this on an open and platform independent backend like GAE. After some research, I have found the following options for a GAE implementation:

  • use memcache. However, there is no guarantee that the memcache is synchronized across different instances. I did some tests and could actually see match request disappearing due to memcache mis-synchronization.
  • Harden memcache with Sharding Counters. This does not always solve the multiple instance problem and mayabe results in high memcache quota usage.
  • Use memcache with Compare and Set. Does not solve the multiple instance problem when used as a mutex.
  • task queues. I have no idea how to use these but someone mentioned as a possible solution. However, I am afraid that queues will eat me GAE quota very quickly.
  • push queues. Same as above.
  • transaction. Same as above. Also probably very expensive.
  • channels. Same as above. Also probably very expensive.

Given that the match making is a very basic operation in online games, I cannot be the first one encountering this. Hence my questions:

  • Do you know of any safe mechanism for match making?
  • If multiple solutions exist, which is the cheapest (in terms of GAE quota usage) solution?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:46:20+00:00Added an answer on June 18, 2026 at 11:46 am

    You could accomplish this using a cron tasks in a scheme like this:

    define MatchRequest:
        requestor = db.StringProperty()
        opponent = db.StringProperty(default = '')
    

    User A asks for a match, a MatchRequest entity is created with A as the requestor and the opponent blank.
    User A polls to see when the opponent field has been filled.
    User B asks for a match, a MatchRequest entity is created with B as as the requestor.
    User B pools to see when the opponent field has been filled.

    A cron job that runs every 20 seconds? or so runs:

    1. Grab all MatchRequest where opponent == ”
    2. Make all appropriate matches
    3. Put all the MatchRequests as a transaction

    Now when A and B poll next they will see that they they have an opponent.

    According to the GAE docs on crons free apps can have up to 20 free cron tasks. The computation required for these crons for a small amount of users should be small.

    This would be a safe way but I’m not sure if it is the cheapest way. It’s also pretty easy to implement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement a chat feature in a turn-based match using GameKit.
Trying to implement a search similar to here .This searches properties based on city,locality,property
I am trying to implement a Flash YouTube video player on this page .
I'm writing a simple game with javascript/html5, and I'm trying to implement gravity. The
Here is my problem. In my game I am trying to implement this leveling
I'm creating a text-based game, and trying to implement procedural world generation. My initial
I'm trying to implement the Media Player custom field control described in this MSDN
I'm trying to implement a notification in to my movie player, so that once
I'm trying to build/implement a Flash video player to play videos. I have looked
I am trying to implement a layout using the new YouTube Player API for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.