Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

Is Python as good as Java for an RTS game server?

Hi

After my trail of Java RTS questions, I'm curious,
Is Python networking / Threading as good as Java's for an RTS game server?

But, Python Threading looks complicated, not just extends Runnable. . .

Should Python be avoided for this? why?

Thanks
Avatar of Mahesh Bhutkar
Mahesh Bhutkar

I preferred Java (High level language) instead of Python(Scripting language) as I am not much aware of Python.

After googling few sites about RTS (Real Time Strategy) game server, I come to know about node.js.  You can think off what they says,

Node.js provides great real-time integration, especially together with socket.io (WebSockets), which provides an easy and transparent WebSocket interface with gracefull fallback to Flash and Long-Polling.

Also, since you will need to simulate the game on the client (latency issues) as well as on the server (the authority simulation), you will need the same code on the server as well as on the client. Since you can only use JavaScript on the client, it is convenient to share some of the simulation code with the server instead of having to rewrite everything.
Avatar of James Hancock

ASKER

I am thinking that the curve to learn a new language, compared to what I can already do with Java, makes the choice easy.
I'm not sure an interpreter can perform as well as compiled Java code, also, for something this complex. - Even if Python is superior? or are computers so fast now, that that doesn't factor in?

I dont see how MIT can think Python is the language of choice to start off CS 101 with, compared to Java? What am I not seeing?
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A Python geek would argue that Python is a better language and it can be used even to produce Java byte code by using Jython (a variation of Python).  Python geeks believe that it is the cleanest possible language.  So, yes, if you like Python like code, you can use it to do whatever, even creating Java byte code.  I had a professor who was a research scientist and used Python for parallel processing and distributed computing in days when it was a very rare thing.

But, if you are used to Java, find Java syntax logical and are used to it, I don't see any reason for you to switch to Python.
Thanks
I will add my 2 cents to this even if the question was answered. One of the most successful and most complex multiplayer real time, strategy and visual online game in the world uses Python on both client and servers sides. They have their own client though, is not a browser game. I am naming here the EVE Online (MMORPG), which is a one server game and holds several records in terms of concurrent players and they had last year the biggest multiplayer battle(spaceships battle) in gaming history.

My knowledge in gaming coding is null but I can appreciate the results and EVE Online is probably the most spectacular game out there, at least in SciFi genre. Some links:

http://en.wikipedia.org/wiki/Eve_Online

http://www.eveonline.com/

http://www.networkworld.com/news/2013/073113-mulitplayer-battle-272367.html

PS. This is more like an EVE Online praise rather than Python. ;) The only problem with this Game is that it is so complex that you practically have to treat it like a full time job, which actually I never did.
The only problem with this Game is that it is so complex

Haha - so true.  I tried EVE a few years ago and after spending 8 hours playing I was still only about 1/3 of the way through the *tutorial*.

Not for the faint of heart, but it is a huge technical achievement.
Sorry for a late add on, but with many other questions' comments and certainly this question, I think I am going to brave doing a Python server, . . game. I got far in my Java efforts, but would prefer to be able to say I did it in the apex language, to not be in clown shoes! - with some help ;) Peer approval is nice.
I mean, I live on the edge of UNCW. If I seek student contributions to the project, (v. likely) they'll think I'm "some far out old man" (Apocalypse Now) if not in Python, like an indication of weakness.

Last time, how can an interpreted virtual machine, which isn't given rapid fire byte code, must analyze lines, be equal to compiled, which is "unclouded by conscience, remorse, or delusions of morality?" (Alien)

Isn't the split, split second of interpretation a factor, or is it inconceivably small?

Does Python have as good inheritance, data structure capacity and polymorphism?
I should leave my comfort zone. - Just forget my reluctance? Is it tedious?

Python UDP looks like a walk in the park!  here
Does it have good byte array construction, conversion capacity? (4 byte integers, etc, how?)
Anything that's not compiled directly to machine code is running some sort of interpreter.  Java's JVM is an interpreter.  But these days Java (and some implementations of Python like PyPy) employ a JIT - which is a "Just In Time" compiler.

That means the first time they encounter the byte code in the interpreter they convert it to machine code and execute that.  So the first time through a piece of code there's a small delay for the interpreter but after that it's the same speed as compiled code.

There is a school of thought that this sort of compilation can actually be better than standard compilers that go direct to machine code.  That's because the JIT compilers operate on a specific target machine (yours).  They can know things like your available RAM,  what CPU you have etc. and *in theory* build code specific for that target.  In practice this doesn't happen very often, but it can be done in some cases.

So interpreted languages can be close to compiled ones for execution speed.  Whether they are or not is usually more limited by the design of the language itself, rather than whether it's using a byte code or not.

Doug