views:

60

answers:

2

I'm developing a web-based fantasy football game. Most of the game is a straight-forward web application built on top of Linux/Apache/Php/MySQL.

I'm trying to figure out how to implement the draft application. The draft date and time will be scheduled in advance by each league's owner. Up to 32 users may be logged on for a given league's draft, and there is no limit to how many drafts may be happening concurrently. The users will take turns selecting players, and each user's turn will have a time limit. I'd like for all the users to be able to see whose turn it is, how much time that user has left to select a player, who they select, and which players are still available. If there are users in the league who are not logged in during the draft I'd like to be able to detect that and automatically assign players to them rather than waiting for the time to run out on their turn. Ideally I'd also like to have a chat window so the users could chat with one another during the draft.

My background is in desktop application development, so if necessary I could write server code in C#/.NET or Java. As far as I can see these are the options:

  • PHP/AJAX - It seems like it would be possible to have all the state for the draft in the database and have the operations for the draft run in PHP triggered by requests from the clients? I guess in this case the draft doesn't start until at least one user logs in, and it seems like it would be a lot of polling requests to the server if I want everyone notified quickly when a user makes a selection.
  • Comet servers like APE or StreamHub - This architecture makes a lot sense to me, but I'm worried that there haven't been updates to the APE server in over a year and the demos on the StreamHub site don't work. Is there a reason these aren't more widely used?
  • Flash - Flash seems to be the most widely used platform for games but I'm wondering if it's overkill for me since I don't need a lot of graphics on the client side? Is there a straight-forward way to use Flash for this?

And some some options I've ruled out:

  • Java - I'd prefer to not require the user to have Java installed.
  • Silverlight - I am familiar with C#/.NET but if possible I'd like to keep the server running Linux.

Any direction would be appreciated!

A: 

Use player.io to host your infrastructure. They have a .NET client and free hosting for a number of users.

edit: on second thoughts, just do it as a website and use ajax polling. The realtime requirements sound pretty minimal

mcintyre321
Thanks, I'll take a look at player.io!
candace
A: 

PHP/Ajax seems like the right solution if the rest of the game code is PHP. I wouldn't worry about performance of polling, particularly with only 32 users at a time. Just have the AJAX check the server ever 5 seconds or so. Maintain state in the database.

In this situation the only obvious advantage I see for Flash here is distribution (there are zillions of flash game portals that you distribute your game far and wide), but that's more of a marketing decision.

justkevin
I realized my question should have been clearer - there can be up to 32 users logged in for each draft, but there is no limit to how many drafts may be happening at the same time. PHP/Ajax would definitely be the simplest thing for me to implement here, thanks for your answer!
candace