Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm going to write a server for an online multiplayer with these requirements:

  • Pretty simple turn based game (think a card game) that is played entirely on the server (security reasons)
  • Must be able to run multiple games (tables) with 4 players per table, but no lobby system required (another server takes care of that)
  • Can support as many players at once as possible; Might need multiple servers
  • Chat between players
  • Socket connection to a Flash/AIR client
  • Must be able to communicate with other servers (for player accounts and such)

Now, I'm considering two options:

  • Smartfox (or equivalent)
  • A custom Java solution in something like Tomcat

Why Smartfox?

  • It handles multiple rooms and chat natively
  • It presumably has solutions for well-known multiplayer gaming issues

Why custom?

  • Smartfox has many unneeded functions, bad for performance
  • Smartfox communicates with an XML-based format, I could use a more efficient binary one.
  • Don't know if running the entire game model on the server is convenient with Smartfox' extension mechanism
  • Multiple rooms and chat are easy to reimplement
  • Tomcat or a lightweight container is easier to deploy than Smartfox
  • Better IDE support for developing on Tomcat (automatic deploy, etc)

What do you think? Are my assumptions correct? Do you have anything to add? What option should I choose (or maybe a different one entirely)?

share|improve this question
    
Maybe I'm missing something, but a "card game" is so simple you could write it from scratch in a trivial amount of time, and performance should never be a problem. –  Lohoris Mar 7 '12 at 14:38
add comment

6 Answers

up vote 3 down vote accepted

I'd definetely go with a custom solution : even though you might lose some time in the short term, it'll definetely scale better if you need it to, plus the experience you gain will be massively reusable for your next games. BlazeDs sounds like an excellent tool for your needs, but rewriting a Java game server from scratch is not that big of an endeavour, using for instance Netty and Protobuf :)

share|improve this answer
    
What is 'Netty and Protobuf'? –  iamcreasy Mar 6 '12 at 20:18
1  
Netty, Protobuf (from the Googles) –  Richard Marskell - Drackir Mar 6 '12 at 23:06
add comment

Regarding your points in support of a custom solution:

Smartfox has many unneeded functions, bad for performance

Since this is for a "simple, turn based" game, performance is unlikely to be a problem.

Smartfox communicates with an XML-based format, I could use a more efficient binary one.

Again, for simple turn based games ease of development can easily take priority over format efficiency, so unless you want to develop an efficient binary format - don't.

Multiple rooms and chat are easy to reimplement

This is not a good reason for choosing to implement this functionality on your own. It's just something that's comforting to know, if you decide to follow this path.

Tomcat or a lightweight container is easier to deploy than Smartfox. Better IDE support for developing on Tomcat (automatic deploy, etc)

You have to weigh how much time you save by developing a custom solution and deploying it fast, versus using an existing solution and possibly doing a longer deployment. Odds are that the development time will offset what little benefits faster/easier deployment gives.

To sum up - I recommend using an existing solution, if possible. It is likely to save you a lot of time. As for which pre-existing solution, that's up to you.

share|improve this answer
    
Regarding your performance point: Yes, the game is simple, but it will need to support half a million players on as few servers as possible (if the client has his wish) –  Bart van Heukelom Jul 30 '10 at 21:13
    
Half a million simultaneous players? Sounds like the Google App Engine comment is worth some additional thought. That will be able to scale from prototype to full-on deployment with nothing but a larger bill. –  drxzcl Aug 13 '10 at 10:31
add comment

Having used both SmartFox and ElectroServer quite extensively, I always recommend ElectroServer. It does all the same stuff as SmartFox, but is just a bit more solid, and includes binary support.

share|improve this answer
1  
what do you mean by binary support ? –  user3689 Dec 1 '10 at 14:00
add comment

I would strongly recommend looking at the Google App Engine project.

Both for hosting and technical reasons. If your game is not fast paced then that should be a good place to get started and up and running, and have the scope to scale.

Code can be in Python or Java.

Neptune's Pride is on Google App Engine. See an interview with the Developer here.

share|improve this answer
3  
Doesn't look like it supports sockets though, only HTTP –  Bart van Heukelom Aug 13 '10 at 22:27
add comment

You should really look into Firebase, an open source Java multiplayer game server.

Compared to Smartfox, Firebase uses a binary protocol, is not bloated with features and is high performing.

If you roll your own system, you will have to take care of everything from handling sockets to handling concurrency. With Firebase, you are guaranteed one action at a time, per room.

Check it out: http://www.cubeia.org/

share|improve this answer
add comment

Take a look at the following netty game server. It supports a binary protocol. Note: Written by me! Has TCP and UDP support, uses jetlang for extremly fast in vm messaging.

share|improve this answer
add comment

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.