A friend pointed me to an interesting ACM Queue article about Darkstar, Sun's open source Java-based MMOG server technology. It's a few months old, but hey, I just saw it!
One immediate reaction is to pooh-pooh Java for games, or high-concurrency servers; but the truth is, both have been done in Java before (the Star Wars Galaxies server tech was reportedly a mix of Java and C++, with most of the game logic - I think - being in Java). And anyway, as evidenced in the big debate from late '07 about scripting languages, we've been debating whether a pure compiled C++ (or C, in the case of Cryptic) or a lower-performing, easier-to-develop hybrid of C++ and Python/Lua/whatever for quite some time - with different developers taking different stances.
So "Java is too slow! Nobody uses Java for games!" is a tempting, but not entirely accurate response.1
Another reaction is one of indignation: I think linking MMOGs to stand-alone, single player games (or regular multi-player games like Unreal Tournament) ignores the strong historical connection from MUDs to MMOGs. Meridian 59, Ultima Online, EverQuest, the early games that helped define this genre are all MUD-inspired, featuring people who started as MUD players and wizards doing everything on the server. I don't particularly care for being referred to as "people who grew up on a single (PC) machine, running a single thread," for whom being asked "to master the intricacies of concurrent programming or distributed systems takes them away from their concentration on the game or world experience itself."
How Dr. Waldo describes us is, still, not a very compelling argument against Darkstar. Take a look at how some game developers talk about their players... the games still stand on their own merit, good or bad. One of the biggest problems I see, actually, is that a Java server and a C++ client (i.e., even a moderately demanding 3D client) will require two separate code bases. There will be a lot of duplicated code for game logic, network protocol, and so on, with a natural inclination to make the two look very similar (or possibly be generated from some master source, a significant engineering project on its own). I have no idea how SWG approached this problem, but they at least had the benefit of a hybrid C++/Java system where presumably the shared code stayed in C++.
I'm also very negatively inclined toward the data access layer. Everything is atomic? Collision detection and aggro calculation are just two of the things that come to mind that could lock the data for every player in a vicinity while they're accessed, and make the game stutter. Mix in the argument against geographic decomposition, and things get even worse - much, much faster than your ability to buy additional hardware.
I am pretty skeptical of Darkstar. At the same time, I expect the trend of which it's a part - making MMOG development more accessible to more people - to continue. Through a combination of middleware, new languages, and more web-centric development, MMOG clients and servers will continue to cover more of the spectrum between "EVE Online" and "Facebook."
Bleh. I should go to sleep. :-)
1. Part of me still resists: in a lot of ways I don't see Java as being particularly better than C++, especially as I've been exploring Boost further. In some ways, Java seems like the worst of two worlds: very little of the dynamic flexibility of proper scripting languages like Python or Lua or Ruby, and very little of the performance from C++ (never mind C). There are other perspectives, of course, like the fact that the learning curve on C++ is much steeper than any of the other languages; or that Java supports a view of good software engineering that the others - including C++, with its operator overloading and template specialization and so on - simply can't support the same way.
Monday, January 19. 2009
Darkstar
at
15:18
| 12 Comments
| No Trackbacks
Defined tags for this entry: c++, you're doing it wrong
Current mood:
tired
(Page 1 of 1, totaling 1 entries)

