Crystal Space: 3D for Free
Pages: 1, 2
The good and the bad of Crystal Space
Overall, the Crystal Space 3D graphics engine was designed to be all-purpose enough to create almost any kind of game. Although it cannot be compared with other graphics programming platforms like OpenGL or Direct3D in terms of features, it has its own advantages over them. It is cross-platform, for one, so you can write code that will run equally well on Unix, Windows, OS/2, DOS, MacOS, and BeOS. A lot of thought was put into the platform independence of Crystal Space. The engine has a flexible plug-in system so that a single executable works with various renderers like OpenGL, Direct3D, and Glide. Along with the 3D API, it even has a 2D API, although, of course, the primary purpose of the engine is to produce 3D graphics. "I wrote a full-blown windowing GUI based entirely on the Crystal Space low-level API," says Zabolotny.
Crystal Space offers lots of features that are very useful if you want to create your own game under it, but its use is not limited just to game design. There are useful pieces of separate code that can be used outside of the engine in projects unrelated to gaming development: a csIniFile class (for .ini file management), an SCF (Shared Class Facility) subsystem, a csArchive class (which deals with .zip files), and a VFS (Virtual File System) subsystem.
Besides its cross-platform nature and code modularity, developers who have been working on Crystal Space in their free time cite the engine's stability (it rarely crashes), the completeness of its 3D rendering features, and a very active community of developers working on the code as other appealing reasons for working on and contributing to it.
The most significant weaknesses of Crystal Space are its lack of good collision-detection programming and its unstable API, since there are often lots of changes made to it and the source tree structure.
"In my opinion, the largest weakness for Crystal Space is its collision detection," says Hieber, who has been spending most of his time improving Crystal Space's capabilities first before working on his game, Crystal Shooter. "There is some support in it, but it is not very useful for real games. There is only static testing of object-against-object that will basically return information about where the collision occurs, if any. But there is no good support for fast moving objects."
Another complicated issue in Crystal Space is how it handles lighting. The engine supports colored static and dynamic lighting with soft shadows, but getting these to work fast under all possible game processing circumstances is a challenge, and one which CS currently doesn't completely meet, Tyberghein admits. The new PVS (Potentially Visible Set) will help address this problem, too.
What's in store for Crystal Space and what's needed
As with most open-source projects, Crystal Space definitely wants and needs more programmers to contribute to its cause. At the moment Tyberghein himself is looking for people who are very skilled at programming graphic engine internals and can also think in terms of algorithms -- people who can essentially help out with perfecting the engine itself. "It is still very fundamental work that is happening in the engine," he says. "I have lots of people helping on the other parts of Crystal Space (i.e., OpenGL and Direct3D programming, Windows and Linux porting) but very few people are capable of helping me with the engine."
"In general, if we had more good programmers, we could do much more," Zabolotny says. "We primarily need people skilled in cross-platform C/C++ programming."
Porting the Crystal Space engine to a gaming console such as the Sony PlayStation is being considered right now. There are some issues, though. A major technical one is that memory on gaming consoles is generally limited, and Crystal Space is rather memory hungry. So the Crystal Space development team plans to address this.
The other issue is a legal one: For some of these gaming consoles, a developer must sign an NDA (non-disclosure agreement) to be able to use the software developer's kit. "To overcome this problem, we are considering putting all NDA stuff in a separate library and then letting Crystal Space use that library," Tyberghein says. "This of course limits the use of Crystal Space in an open-source way on those platforms, but at least someone would be able to write that library again and then use the engine unmodified."
So could Crystal Space, or any open-source 3D graphics engine, become as widely used as the commercial engines? Tyberghein expresses some doubts. "If you license the Quake 3 engine, then you're sure to get a quality product that will work regardless. So if you want technical support, you should NOT use a free engine," he says. "However, if you feel like you can cope with the lack of support or if funding is a problem (which is the case for many people), then an open-source engine is for you."
As for any particular type of games Tyberghein would personally like to see others develop under Crystal Space, he thinks there are enough people developing games right now for the engine. What he would like to see more are non-game-related applications. "The Crystal Space engine is not game specific. There is nothing inside the engine that says, 'This is only useful for games,'" he insists. "Other uses for Crystal Space could be architectural, for example, or maybe for a garden designer program. There are lots of possibilities."
But there's still that one top project he'd like to see others develop someday using his 3D graphics engine -- a 3D version of Nethack. Ironically, this fantasy role-playing game -- a classic among the open-source gaming community -- has usually eschewed fancy visuals. The latest version of this 15-year-old game, released earlier this year, continued with the tradition of rendering the game's graphics in simple ASCII characters.
"I really love Nethack, and I will always keep playing it in ASCII form. But I think that a 3D version of Nethack should be possible," Tyberghein says. "I'd really love to see that happen with Crystal Space."
Discuss this article in the O'Reilly Network Linux Forum.
Return to the Linux DevCenter.