We’ve started on the design for the next game and as it’s going to use a completely custom client I’ve been looking around at more general socket servers for the backend. I had toyed with the idea of using our existing engine built on top of Nakedmud, but came to the conclusion that we need something more robust and scalable for this new game. So for the last couple of weeks I’ve been evaluating some of the different server backends that are available, namely SmartfoxServer, Photon and Project Darkstar.
SmartFoxServer
This looks like it is aimed squarely at the multiplayer Flash game market with a design based on the concept of zones and rooms. These aren’t zones and rooms in the MUD sense, but rather a zone is a self contained application and a room is a grouping of clients within that application. An example would be a server running many different small multiplayer games (chess, noughts and crosses, etc) where each game type was represented by a zone and each instance of a game was a room.
The server itself provides a lot of functionality out of the box such as a lobby, buddy system and user management and there is a choice of XML, JSON or String message protocols over TCP. It also supports user and room variables that can be dynamically created and are automatically propagated to other clients. The PRO version can be extended on the server using custom extensions written in Actionscript, Java, Javascript or Python. These custom modules hook into the server framework at the room or zone level by handling messages from clients and internal server events.
I found Smartfox easy to use with plenty of documentation and examples. However, the more I looked at it the more I found I was bypassing the built in functionality or replacing it with my own custom code. I think I could definitely make it work for what we want, but it felt very much like trying to fit a square peg into a round hole.
Pros:
- Good track record in commercial projects, eg. Disney’s Club Penguin
- Well supported and documented
- Much more than just a socket server
Cons:
- Free version only supports up to 20 connections
- Additional features could be seen as bloat if you don’t plan to use them
- TCP only and default XML protocol has a lot of overhead
Photon
Exit Games have two products; Photon and Neutron. Neutron looks to be a kind of managed rival to SmartFoxServer with lobby system, buddy lists, high score tables, chat and user management features built in, whereas Photon is just the socket server part and the bit that we are interested in. The server can be extended in much the same way as SmartFox by handling messages from clients and responding to internal events such as a client login. Photon is also much newer than SFS which means that while it is arguably a cleaner and more tightly focused product, it lacks documentation and real world examples. Photon is developed in C# and can be deployed on Windows servers only.
I didn’t spend as long with this as I did with SFS but I felt it was quite similar in overall design and provided a lot of the same functionality such as organising clients into rooms and the ability to share client data. One major difference between the two is that Photon offers a choice of UDP or TCP based message protocols. The received wisdom is that UDP is preferred for realtime games where you are more concerned about the most recent client state and TCP is preferred when data integrity is paramount. As far as MMOs go you can find successful examples that use either or both, so take you pick.
Pros:
- Clean and tightly focused design with little additional cruft
- Support for both UDP and TCP
- Good integration with Unity, including an “MMO” Island demo
Cons:
Free version limited to 30 day trialThe free version is no longer time limited, see comments- New and unproven with few real examples available
- Server is limited to Windows only
Project Darkstar
This is a quite a different beast from the previous two offerings in that it is an application framework designed for multiplayer games rather than simply a socket server. It’s free and open source and developed by Sun, so it’s got to be worth a look. PDS promises three main things; horizontal scalability, data integrity, and a single threaded event driven programming model. It does this by managing access to data behind the scenes in such a way that objects can be distributed intelligently across multiple nodes with issues of thread safety largely hidden from the developer. All objects are transparently backed up to an object store and the whole server state is persisted in case of failure.
I like PDS and of the three servers I’ve looked it is definitely the most heavyweight and ambitious; the problems it sets out to solve are serious and complex issues in any persistent MMO design. It’s been in development for several years now but is not yet at a 1.0 release and multi node support (arguably one of the biggest selling points of PDS) has only just been implemented. The client support is also much less complete than either SFS or Photon, with only a Java API provided as part of the project. There is a community C# port (for Unity) but it appears to be a little outdated.
Pros:
- Commercially proven, eg. CampFu
- Free and Open Source, backed by Sun
- Provides scalability, concurrency and data integrity
Cons:
- Multi node support still very new
- More complex design
- Fewer client API options
Conclusions
Like most things, there is no single “best” solution for what we need. None of these three products provides exactly what I want, but I am confident any of them could be made to work. At the moment I am leaning towards either PDS or Photon but need to do some more testing and evaluation.
PDS is definitely more complex than Photon, but arguably that’s because it attempts to solve a much more complex problem. I like the look of Photon; it seems lean and clean and easy to do what I want with it, but it’s a much lighter weight system than PDS. This new game is more ambitious than Maiden Desmodus for sure, and the inclusion of 3D graphics will give us a much wider appeal, but I think we’re unlikely to have to worry about concurrent users in the tens of thousands. Adopting PDS may be akin to taking a sledgehammer to crack a nut. Photon promises more uncertainty about how it will scale, but it looks like it does the basics very well and it offers a good integration with Unity which is our likely client choice (more on that in another post maybe!).

Wow, interesting! When you say ‘the inclusion of 3D’ I wonder if this means a full 3D environment, or something else?
Incidentally I was looking at Mantissa the other day, an application framework built on Twisted with its own data store. I suspect it’s more experimental (i.e., buggy ;D ) than you may be interested in though.
LikeLike
I’ll post more about it once I’ve made more progress, but essentially it’s going to be a sci-fi themed game with ground based play in text and space flight/combat in a 3D environment.
I’d not heard of Mantissa, but I’ll definitely check it out, thanks!
LikeLike
Thanks for this interesting read.
just need to say that smartfox allows JSON messaging protocol (I’m using this on smartfox) so XML overhead becomes less of an issue.
Shame that photon is platform-dependent, I was interested in it until I discovered that.
LikeLike