Linux DevCenter    
 Published on Linux DevCenter (http://www.linuxdevcenter.com/)
 See this if you're having trouble printing code examples


WorldForge: In Pursuit of Open Source, Massive, Online Games

by Howard Wen
01/31/2002

Ultima Online is what gamers call a massive, multiplayer, online, role-playing game -- or MMORPG, for short. In this kind of environment, tens of thousands of players interact online. In some ways, it's like open source development, where a distributed collection of users (or developers) works together to make something happen.

One group of programmers is setting out to build a MMORPG using just such an open source model. WorldForge is an online community that formed three years ago to create such a game. The results of their early efforts were unveiled last year at LinuxTag 2001, with a working demo of their first online, role-playing game, Acorn.

Since that debut, the WorldForge community has gained a few hundred new contributors, but it's still a fairly small group. The game's announce list has 455 members, and on any given week, 10 to 20 folks commit code, content, or media. The group's focus now is on the development of a second game, Mason, and on working out the core principles around which clients and servers will communicate using the network protocol that WorldForge's programmers created, Atlas.

"The feel of the project has changed as people have come and gone, but all in all it feels as though we are really getting somewhere," says Al Riddoch, a 27-year-old from Southampton, U.K. Riddoch coordinates the development of Acorn and Mason when he's not working as a systems programmer for the University of Southampton. "Now we have more momentum than we have ever had before."

A task that's too big

The idea of an open source clone of Ultima Online hasn't evolved in the way it was originally envisioned. A few days after WorldForge was announced, one of the first decisions made by leaders of the effort was not to clone Ultima Online. They felt that the hack-and-slash play strategy of such games was boring and limited.

They also felt that from a technical standpoint, it was unrealistic to try to build a game that would serve tens of thousands of players simultaneously.

"We're a long way from cloning a commercial MMORPG, even if we wanted to," admits James Turner, a 21-year-old developer in Edinburgh, Scotland who works in Mac Mozilla development for an educational software company. He coordinates architectural development for WorldForge game servers and maintains a client-side session layer used by the project's various in-development clients.

So WorldForge focused on creating a generic game-engine client and server that would be flexible enough to support virtually any kind of online, role-playing game.

Obviously, a networking protocol is needed to run games like these. WorldForge programmers built such a "glue" to bind together large numbers of different clients and servers, along with editing tools for online games. Named Atlas, it's a technology that the community has been honing and aiming to have stand apart from the networking protocols used in commercial, online games.

Atlas is dynamically extensible and self-defining, so servers can communicate new types of entities and operations (actions) to the client. Clients can flexibly support various rule-sets and games without custom code, and new entities can be defined at will. This allows content creation to be much more iterative, and it enables a much looser client-server relationship than is traditionally possible. Present work on Atlas will also allow the protocol to be extended without the client or server needing to be restarted.

"Atlas is probably way ahead of anything being used commercially in terms of flexibility and power," says Riddoch. "We are frequently told that Atlas is over-engineered and too slow, but I believe that in the long run, it will pay off. As CPUs get faster, the cost of this flexibility will diminish, and performance will be less of a problem."

Building on simple games

The first game developed by the WorldForge team, Acorn, was mainly an experiment for them to learn how to develop a very basic role-playing game. Players compete online to raise and sell pigs in a world rendered in 2D, isometric graphics. Compared to the vast scale of Ultima Online, the size of Acorn's environment is much smaller and it serves fewer players; its gameplay is simpler, too.

Screen shot of acorn.
Screen shot of the role-play game, Acorn.

The work on Mason, the second WorldForge game under development, aims to develop ways to build and manipulate objects in a role-playing game, and to better understand the physics engine. Mason's world features two races, humans and orcs, who compete for resource materials that include trees, animals, and iron ore. There will be no combat or spell-casting; threats to player-characters will come in the form of inanimate objects like deadly traps and poison.

Related Reading

Physics for Game DevelopersPhysics for Game Developers
By David M. Bourg
Table of Contents
Index
Sample Chapter
Full Description

"We're hoping that a social structure, completely different from the culture grown in the Ultima Online world, will emerge in Mason. When [acquiring] power and money are the only objectives, things get boring very quickly," says Oliver White, a 24-year-old software engineer in Melbourne, Australia who's developing a program to import data from Relational Database Management Systems (RDBMS) into the game-world model to be used for Mason. The absence of violence can present a different challenge to the gameplay, he adds: "When your neighbor builds an outhouse on your prized strawberry patch, and you can't simply knock him on the head with a club, things become a bit more interesting."

Overall, the idea behind the designs of Acorn and Mason is to build the various elements of online, role-playing games, little by little, over a series of simple-to-play games that aren't too daunting to make. More complex games can then be built upon the work of these successes. "By doing the [games] on a low level with a small set of core rules, we can avoid a lot of the balancing problems that arise from creating a large number of rules," explains Hans Häggström, a 24-year-old software engineer in Helsinki, Finland who is handling the lead design for Mason.

Technical challenges of online development

Designing these online, role-playing games under the open source model has presented three challenges unique to this category of gaming development that the WorldForge community has been working to iron out.

Database Reliability. MMORPG servers typically use a database to store the game-world state, and the performance and reliability of such a database is critical. The problem that the WorldForge team faces is finding a good open source or freeware database system that can fulfill the job. "It remains to be seen whether a free RDBMS is available that is good enough for our needs," says Riddoch.

"MySQL performs poorly under a heavy load," he says. "In particular, it does not handle very large tables well and does not optimize complex queries well. Until recently, PostgreSQL was generally too slow, though recent performance improvements mean that it is now a good candidate, and it's currently the preferred database for WorldForge servers."

But PostgreSQL has its own drawbacks, says Bryce Harrington, WorldForge's Project Coordinator and a 30-year-old engineer from Tigard, Oregon who works at the Open Source Development Lab. PostgreSQL "has many of the needed features MySQL lacks but is a little stricter. For read-only applications it can be significantly slower than MySQL, but we have not done any benchmarking or timing so we can't really say much there.

"Our database design is only modestly relational. Most of the data goes in just a small number of tables. Because of this, our database needs are going to emphasize the need for a few specific features, such as row-level locking and query caching. We believe PostgreSQL is a better fit than MySQL on these counts, but we aren't ruling out the possibility that other databases may be even better suited."

Core Servers. "There is very little information on such systems, whereas clients--especially on the graphics side--are quite well described," says James Turner.

There are lots of articles discussing client and server design for Quake-style games, but the WorldForge programmers have found scant information that elaborates on how server setups for other types of online games are put together. Apparently, commercial, online game developers are reticent about revealing the inner-workings of their servers. Using existing MOO, MUD, and MUSH code hasn't been of much help either.

So, for now, server design has been a guessing game. "While the basic functions [of the server] are obvious, in three years we have seen all manner of proposals as to how the game server should be architectured," says Turner.

Performance Issues. With Acorn, the performance of the game has bogged down largely due to the game's artificial intelligence (AI) engine. This is going to be tuned-up in future releases of Acorn, but it could be the tip of the iceberg: What will happen when future games, loaded with more features, are developed?

"Until we start scaling up the number of clients, rule-sets, types of objects, number of objects, and number of moving and colliding objects, we don't really know which aspect is going to limit us," admits Turner. "Will all these things scale equally? Will we spend 95 percent of our time doing collision detection? Everyone is writing their code with the expectation that it won't hog vast amounts of CPU, but until we start scaling the world up, we're just guessing. Still, we are trying to 'optimize last'--or at least not prematurely."

Think big but develop small

Despite the technical hurdles, the WorldForge programmers confidently feel that such problems are the least of their worries and definitely manageable. Along with building good code and organizing a team of talented programmers, the primary lesson to learn from the WorldForge community, when it comes to creating a complicated game under the open source model, is to take things a little at a time. Every mini-game, like Acorn and Mason, that they can successfully make will eventually lead to the bigger goal of building a more large-scale, online gaming experience. "Developing our games incrementally lightens the brain load considerably," says White.

In terms of features and technology, WorldForge's programmers think they will be able to match or exceed the commercial offerings eventually, as long as they stick to their "incremental" plan of action. That may sound a wee bit optimistic or naive, but already the programming for the non-player characters in Acorn is as sophisticated as that of many commercial titles.

"Cyphesis, the server for Acorn, uses a goal-based system for programming non-player characters that allows us more advanced behavior than that displayed in the commercial MMORPGs I have played," says Riddoch.

For example, the pig sellers in Acorn are only around during the morning and afternoon. At lunchtime and in the evening, they hang out at the inn. The pigs themselves have herding behavior, which means that if a group of pigs stays together for some time, it can be driven as a herd. "Acorn only touches the surface of the capabilities of our code," says Riddoch. "It is my hope that later games will demonstrate how much depth our non-player characters can have."

"It should be added that in spite of, or perhaps because of, these capabilities, the quantity of players that can be supported by Cyphesis may be rather limited, especially compared with the [commercial] MMORPGs," admits Harrington. "However, we did not intend Cyphesis to handle such intense loads. Its objective is to provide specialized AI services and, thus, to run as a specialized subsystem for the main server."

Making your own worlds

The biggest strength of the WorldForge project is that the community can support the type of online games which might not be viable in the commercial marketplace. Since there is no need to be concerned with drawing in large numbers of paying subscribers to recover capital investments, the focus can then be on creating specialized games for a niche of players. To encourage this sort of development, the WorldForge project offers the tools for anyone to develop his or her own online, role-play worlds and rule-sets.

That's what the people contributing to WorldForge envision as the "ultimate" online world: one where players can not only romp but can also alter to create a whole other virtual world experience for others to enjoy. The more unique these massive, online worlds are, the better.

"What you'll see is everyone's idea of a good game coming to light," says Oliver White. "People with expertise in various subjects will be able to have their say on how to implement game rules, from fencing experts to fluid dynamicists to ecologists to indigenous theologians."

Howard Wen is a freelance writer who has contributed frequently to O'Reilly Network and written for Salon.com, Playboy.com, and Wired, among others.


Return to the Linux DevCenter.

Copyright © 2009 O'Reilly Media, Inc.