Seriuosly interested, why is Node.js better suited as a gameserver than say C or Java ?
What exactly are you doing on the serverside? Is it an authorative setup or are you just passing position messages around (in which cases huge amounts of players wouldnt be suprising) ?
Did you reverse engineer minecrafts multiplayer protocol or is this an alternate implementation?
EDIT just looked it up and it seems like the minecraft network protocol is public, so no reverse engineering needed. It also looks like its not an authorative setup which could cause cheating problems in PvP enviroments down the line
Sure, Java or C will be much faster at any computational work. And I am no node.js fan-boi. But doing actual asynchronous local-file IO in C is non-trivial, and if their server is not CPU bound, there doesn't seem to be anything wrong with using node.js. Could you also use libuv from C? Sure.
The OP made too general of a statement because there are certain cases where V8 can preform better than the JVM; however, generally Java does seem to perform better (ignoring startup time).
Heh. Last time I checked v8 regexes were really fast, except their string builder was a disaster... it wrapped every piece of string as a js object (gc and everything).
Sounds familiar to Java's own string concatenation. In Java you use StringBuilder / Buffer to create larger strings from smaller ones; in Node you'd use Buffers, although I never dived too deep into those.
im not an expert but arent UDP Socket connections more like an fire and forget scenario which doesnt create alot of waiting ? Id think that game servers have to compute heavier stuff per tick and have to process all the incoming packets anyway so that waiting for IO isnt really an issue ?
It might make sense to have the game world updating and sending/recieving packets in different threads though, so is that were nodejs makes sense?
The network stuff is, yeah. But presumably you want your minecraft world to be durable, which means hitting disk. And you don't want your network stuff blocked behind that.
ok makes sense but i wouldnt write every change to the disk anyway. The server state can well be kept inside memory and only be saved once in a while, but nevertheless doing that in a different thread would make sense.
The protocol isn't public and Mojang has always refused to say anything about it. The protocol is RE'd by http://mcdevs.org/ which runs http://wiki.vg. There is no technical or otherwise limitation on authorization, they just haven't implemented it yet.
What exactly are you doing on the serverside? Is it an authorative setup or are you just passing position messages around (in which cases huge amounts of players wouldnt be suprising) ?
Did you reverse engineer minecrafts multiplayer protocol or is this an alternate implementation?
EDIT just looked it up and it seems like the minecraft network protocol is public, so no reverse engineering needed. It also looks like its not an authorative setup which could cause cheating problems in PvP enviroments down the line