Yo Frankie! | Crystal Space Tutorials

Project structure

by Dariusz Dawidowski

Directory layout

doc - documentation and tutorials
Contains two types od documents: development : design docs, plans, schedules, and public : tutorials especially made for community.

prepro - pre-production data like concept arts
Concept arts, sketches of game assets.

pro - production source files
Here are all source files.

pro/audio - audio files
Vorbis Ogg sound effects and musics plus wav version for BGE.

pro/bge - Blender Game Engine files
Source files for version of the game made using Blender Game Engine.

pro/chars - Blender files with characters
Contains .blend files with animated characters. Refers to relative ../textures directory. Also links to geometry from other files like ../levels/testground.blend, sometimes links to other characters, so almost every blend file here is like small game and allows to test logic very quickly without exporting and running real game levels (see Linking below).

pro/gui - graphic user interface elements (textures and fonts)
PArts of user interface and HUD (things displayed on screen during game lik elife meter, points etc). Meters are in subdirectories containing graphics for each step.

pro/levels - game levels concerning other assets
Game levels, which in fact contain only custom terrain and any other objects are linked from relative ../props directory and arranged on terrain.

pro/props - 3d assets
Collection of the 3d models, sorted by type, with reference to relative ../textures directory for textures.

pro/puzzles - Blender files containing puzzles
Test levels containing puzzle to solve. In real level objects are arranged in dirrerent places, here is arranged in easy way to finish puzzle for test purposes.

pro/scripts - xml scripts for quests and animations

pro/scripts/cfg - configuration files
Files with configuration for Celstart, like keyboard bindings for example.

pro/scripts/components - Python components
Contains python scripts for custom Property Classes.

pro/shaders - custom Cg shaders
Crystal Space has a lot of ready to use shaders (in CrystalSpace's data/shaders directory), so don't forget to add them to own deployed game. But many games contains also custom shaders typical only for this kind of game.

pro/testcases - helpler game levels for testing features
Levels for test purposed. To develop better game we tested moving and colliding through walls, jumping, gliding etc. in simple syntetic environment, after this in real levels then.

pro/textures - game textures
All game textures. Final game using .dds format which better fits to modern graphic cards capabilites and was made especially for this. B2CS can detect .dds texture beside of original .png file with the same name and use it.

pro/tutorials - example files for tutorials
Soem tutorials needs real examples in the .blend files, so refer this directory during reading tutorial.

runtime - final game structure ready to deploy
After development process, compiled files, prepared textures, exported models to Crystal Space format, and all final things ready to make game package are here.

Linking

Blender has very powerful feature to link object from one .blend file to another .blend file. This way for example game designer can use simple dummy object and continue work on scripts. Meanwhile artists working on nice models and can exchange dummy object with final one and magic ! it will appear also in other files. It's similiar to Unix file symlink. But during exchanging model don't forget to copy all B2CS properties from dummy object (CTRL+C in 3d View with active B2CS which overlaps native Blender's CTRL+C).

Step 1 - Add object(s) to group

  1. Add to Group -> ADD NEW, name it. Or just assign to existed group in case when it is next object (for example armature - don't forget add it to the same group too).
  2. Probably you want to keep group in the center, it's easiest way to rearrange multiple objects in a linked files otherwise center will be in werid place. On other side sometimes you want to nicely arrange 3d assets in source .blend file beside of eachother. You can set position offset to fix this then. In this case push N KEY in the 3d View window, read object position and type these values here.
  3. Last thing to remember about groups is layer visibility. If one layer will be enabled there and object will be on other layer - will be not exported by B2CS. So better just enable visibility on all layers.

Step 2 - Link to group

So lets make a level. Simple plane for tutorial purposes.

We want to link our main character to this level. Choose File -> Append or Link.

Find file with character. You cna navigate inside .blend file like in directory. Find directory 'Group' inside and push Load Library. Don't forget to enable 'Relative Paths' and 'Link'. Relative paths are good habit in every project, because it's always relative to blend file which you using not to local directory structure on computer, so project is portable between computers. Link is for linking only, otherwise you cna use Append, but object will be copied to level file not refered.

Now object is in memory we need to add it to scene. Push Space, Add->Group->(name of the group)->(name of the object). Object will appear in 3d cursor position.

« back