Completed Installation of Crystal Space on Klystron Today

In This Posting, I wrote that I had installed “Crystal Space 2.1” on my laptop named ‘Klystron’.

This is an open-source game engine, which competes with “OGRE“, the latter of which is also open-source.

It is not enough just to have the game / rendering engine installed. In order to create content, authors also need to use 3D Model Editors, and the most important of those available in the open source community, happens to be ‘Blender‘, which has its own file-formats for storing projects.

Therefore, one also needs to install the add-on into Blender, which will allow it to export what we have created within it, into Crystal Space format. Fortunately, when I compiled Crystal Space, I did so with full Python support. Blender scripts happen to be written in Python. And in the appropriate shared directory, the Blender add-on could be found.

One word of caution though. In order for this add-on to work properly, Blender must be started with the ‘CRYSTAL‘ environment variable set. This can be done from the command-line, but eventually the authors will want that taken care of automatically.

And so, there is a root directory named ‘/etc/profile.d‘, into which we can put localized environment variables, set and exported by scripts, every time the computer reboots.

Also, this add-on differs from most of the export-plug-ins, in that it operates Blender as a Scene Editor, and not just as a Model Editor. Thus, we find it in a different section of add-ons for the user to enable. Instead of finding it in the ‘Import-Export’ section, we find it in the ‘Game Engine’ section. This is also from where Blender finds add-ons, that allow games created within this editor, to run stand-alone as games…

Once this has been taken care of, it becomes possible not just to export our Blender Scene, but then to jump right into it and test it, using the program named ‘walktest‘.

walktest is a simplistic game-like program, compiled against the Crystal Space libraries, which can usually just be typed in from the command-line under some Linux setups, and which accepts as argument, the name of a Crystal Space World to explore. walktest enables basic movement and collision-detection, without causing any real game-play to take place.

The number-key ‘8’ toggles gravity on and off, which is actually quite useful, because we may often export a scene which is not yet complete enough to have a floor, nor a terrain… The demo will fall into an abyss of emptiness, because of the same gravity rules that also allow walking up and down stairwells, unless we then turn gravity off.

This ability, to preview our scene while Blender is still editing it, has traditionally been a part of how earlier versions of Crystal Space worked as well.

There has been an improvement over earlier designs of Crystal Space. Before, it used to be that ‘walktest‘ needed to build light-maps, if those were not already built, in order to run, and to do so in the same directory as the directory which holds the scene to be tested.

In cases where the demos are stored in root directories, regular users do not have privileges to build those light-maps. Therefore, the root user used to have to disable X-server cookies, go into root mode, and then run walktest once on each demo, so that when non-privileged users next tried to test those demos, they would find that the light-maps were already built, and that therefore they could explore the scenes, without having elevated privileges.

The way it now works in version 2.1, the user does not need elevated privileges in order to build the light-maps. It seems to be a part of how the Virtual File System works now, that some of its elements are located someplace in the home directory of the user, or under ‘/tmp‘.

Dirk

 

Print Friendly, PDF & Email

One thought on “Completed Installation of Crystal Space on Klystron Today”

Leave a Reply

Your email address will not be published. Required fields are marked *

Please Prove You Are Not A Robot *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>