views:

406

answers:

6

I'd like to get busy with a winter programming project and am contemplating writing an online word game (with a server load of up to, say, 500 users simultaneously). I would prefer it to be platform independent. I intend to use Python, which I have some experience with. For user data storage, after previous experience with MySQL, a flat database design would be preferable but not essential. Okay, now the questions:

Is it worth starting with Python 3, or is it still too poorly supported with ports of modules from previous versions?

Are there any great advantages in using Python 3 for my particular project? Would I be better off looking at using other languages instead, such as Erlang?

Is there any great advantage in using a relational database within a game server?

Are there any open source game servers' source code out there that are worthy of study before starting?

A: 

A project of this kind could be a great way of investigating a new language. I'd say that Erlang is one of the more interesting languages out there, (1) being functional, (2) offering a superb concurrency / (distributed) parallelism paradigm, (2) seeing use in the industry (most notably & traditionally telecommunications), (3) actually entering the desktop space (CouchDB). If you don't know it yet, go for it! :-)

As for open source game servers... Well, there's plenty. Google around for MUD engines etc. For starters, check out the Wikipedia entry on MOOs and look at LambdaMOO.

Michał Marczyk
A: 

If you're already fairly familiar with Python, then I'd investigate the Twisted library if I were you. Twisted is an asynchronous comms library that was originally developed to support a large text-based game.

The current level of support for Python 3 by commonly used libraries is not high - so you probably want to stick with something like Python 2.6 at this point in time.

Jon Mills
+2  A: 

I would go for Python + Django. It makes web application developments pretty easy.

jbochi
Yes, Python 2.x and Django would be a great combination for this task. I am also a fan of using an ORM to abstract the database, and the ORM in Django works well for the simple kind of database stuff you would need for this application. The Django guys recommend PostgreSQL over MySQL, so I would recommend you give that a try.
steveha
+2  A: 

Is it worth starting with Python 3, or is it still too poorly supported with ports of modules from previous versions?

depends on which modules do you want to use. twisted is a "swiss knife" for the network programming and could be a choice for your project but unfortunately it does not support python3 yet.

Are there any great advantages in using Python 3 for my particular project? Would I be better off looking at using other languages instead, such as Erlang?

only you can answer your question because only you know your knowledge. Using python3 instead of python2 you get all the advantages of new features the python3 brings with him and the disadvantage that non all libraries support python3 at the moment.

note that python2.6 should implements most (if not all) of the features of python3 while it should be compatible with python2.5 but i did not investigated a lot in this way.

both python and erlang are candidates for your needs, use what you know best and what you like most.

Is there any great advantage in using a relational database within a game server?

you get all the advantages and disadvantage of having a ACID storage system.

mg
+1  A: 

Related to your database choice, I'd seriously look at using Postgres instead of MySQL. In my experiance with the two Postgres has shown to be faster on most write operations while MySQL is slightly faster on the reads.

However, MySQL also has many issues some of which are:

  • Live backups are difficult at best, and impossible at worse, mostly you have to take the db offline or let it lock during the backups.
  • In the event of having to kill the server forcefully, either by kill -9, or due to power outage, postgres generally has better resilience to table corruption.
  • Full support for ACID compliance, and other relational db features that support for, again imho and experiance, are weak or lacking in MySQL.

You can use a library such as SQLAlchemy to abstract away the db access though. This would let you test against both to see which you prefer dealing with.

As far as the language choice.

If you go with Python:

  • More librarys support Python 2.x rather than Python 3.x at this time, so I'd likely stick to 2.x.
  • Beware multi-threading gotchas with Python's GIL. Utilizing Twisted can get around this.

If you go with Erlang:

  • Erlang's syntax and idioms can be very foreign to someone who's never used it.
  • If well written it not only scales, it SCALES.
  • Erlang has it's own highly concurrent web server named Yaws.
  • Erlang also has it's own highly scalable DBMS named Mnesia (Note it's not relational).

So I guess your choices could be really boiled down to how much you're willing to learn to do this project.

Bryan McLemore
+1 for the Postgresql / Python 2.x recommendations although I do not fully agree with the need for SQLAlchemy
ChristopheD
I recommend it because I find abstracting away from SQL to be useful, not a strict requirement by any means. It did help on a project where we outgrew MySQL and needed to swap over to Postgres though.
Bryan McLemore
A: 

I am very much interested in the code as i would like to set up a wordgames trivia website. i wrote to the above addy and any reply would be appreciated .

J.H.Boggs