Architecture for a multiplayer browser game (backend selection + external selection [flash / silverlight])

I am thinking of developing a multiplayer online game on the Internet. The general state of the world will require something fast on the backend, so potential solutions look like this:

  • fast game engine on the server (for example, C ++) and some external interface (php / python / ruby) + flash

  • entire stack in python (using twisted or sloppy python) + flash

  • .NET (asp.net or asp.net mvc) + flash

  • .NET + silverlight

the first may be redundant in terms of productivity (3 heterogeneous layers)

Nr. 4 may be a heaven programmer (common environment on all layers), but:

  • No such thing has ever been built with Silverlight, there may be some demonstrators lurking around the corner.
  • It can be difficult to find Silverlight designers.
  • Despite the fact that the Flash / clip model is criticized in comparison with the full OO SL architecture, is this not an advantage when it comes to developing additional parts of the virtual world by external designers? They can just prepare .swf for example. 4 element perspectives on 4 frames - wouldn't it be harder with SL?
  • Silvelight seems to lack some game features (e.g., conflict detection)

what do you think?

[EDIT] The game itself will be part of a larger portal - so it would be nice to integrate the engine with some web map.

+4
source share
3 answers

Option 2 - Using Stackless Python is what Eve Online uses.

http://support.eve-online.com/Pages/KB/Article.aspx?id=128


Edit

As long as you have real software, of course, it is impossible to create an architecture that works quite well. So, any judgment here is just idle speculation.

However, consider the following.

  • Static content (.js files, .css, .png, etc.) tend to dominate your network bandwidth. To do this, you will need to use a reverse proxy server (e.g. squid).

  • Squid must get the content from somewhere. You want the lightweight file server to provide static content to the squid. Nginx or lighttpd or something like that. Apache will work for this, but - to some extent - it may be redundant.

  • Your dynamic content - it will appear - will be in two forms.

    • JSON to support the game.

    • HTML to support the portal.

    For this, you will be best off working with the mod_wsgi engine. Apache certainly does this; ngingnx and lighttpd may also work.

    • Your JSON stuff must be a single set of URIs. REST is a good design template. Through mod_wsgi they connect to the game server, using - if necessary - free Python. Your interface (e.g. Apache) has a location, directory, or virtual host to filter out this URI and redirect them to the mod_wsgi daemon that serves the game. See Wekzeug to create this.

    • Your HTML stuff is another set of URIs. Through mod_wsgi they connect to the Django server, which runs regular Python. Your interface (e.g. Apache) has a location, directory, or virtual host to filter this URI and route them to the mod_wsgi daemon.

+3
source

I spent a year working on a multiplayer online game using Silverlight for the interface and Python for the backend (I actually used IronPython in Silverlight to make development easier)

Silverlight is very suitable for this, I would not be a serious online game in anything else. It already has 35% of the market, by the time you finish development, it should be high enough not to make much difference. For serious games, most people really do not mind installing a 4MB browser. If you just want to clone some asteroids, use the flash.

If I had to do this, I would put Python on the server, because it is the server technology that I understand most of all, but I think I would use C # on the interface and use JSON to transfer data.

The best advice I can give you:

  • Use existing libraries and code as much as possible
  • Do not think about performance prematurely

The hardest part is to finish the game, use the technology that you know well, and optimize your time, not the code. I hope you can do what I could not - finish the damn game :)

Edit

Regarding why I used C # if I had to do this:

IronPython had its advantages and disadvantages. It was great that I could share code files (constants, models, etc.) between the server and the client. Make changes and refresh your browser to see that it was awesome. Debugging was not as friendly as C #.

But in a way, this is a second-class citizen for C #, data binding does not work, and you cannot use IronPython classes in xaml. Download time was a problem, so I really spent a lot of effort to set up import in parallel across background threads to speed it up. Due to the second citizen status that uses xaml, I used the template language to generate xaml, as if it were html that really worked better than data binding, but python template languages ​​did not work in IronPython, so I wrote my own ( next time.)

To enable sharing models, I had to write my own ORM. It was easy enough. But to pass them, I passed JSON and instead created an optimized binary format that worked between IronPython and Python. It was a different time.

In retrospect, I should not have been distracted by all these rabbit paths.

+6
source

Rolled up for this purpose has been successfully used. Based on asynchronius, it is very effective for applications requiring persistent connections. He also has a good RTMP implementation for use with flash. Check out the chess park built with Twisted:

http://www.chesspark.com/

Plus, the game engine does not have to be in c / C ++. Depends on the complexity and type of game. But there is also a pygame library which is pretty good.

Personally, I would discourage you from using silverlight. The flash plugin is much better accepted and will remain in the foreseeable future, especially on operating systems without ms. Do not take it to heart, but I would not install Silverlight to see your game.

+5
source

All Articles