[back to main page]

The Castle — development

Please note that I consider "The Castle", as a game, finished now. Hey, it was fun, it was great, and thank you for everyone that helped! Now let's make something even better :)

New game, using much improved "The Castle" engine, is planned — this new game will be technically "The Castle 2.0" (although actual name planned now is "Human Programming"). I don't plan to further extend "The Castle" data (no new levels, no new creatures etc.). It makes more sense for me to focus on new game data, that will use many engine features added after "The Castle" release.

This isn't supposed to discourage you from dabbling in "The Castle" data :). On the contrary, feel free to experiment even more, create levels / creatures not necessarily tied to the current "The Castle" mood. Hey, you're welcome to start a new game on your own, using "The Castle" engine. (Almost) everything documented here will also apply to the new game, so information on this page will certainly remain relevant.

"The Castle" is developed in an open-source manner, which means that if anyone wants to help — you're more than welcome. You don't even have to be a programmer — 3D level/creature designers are wanted (alive!), and sending simple feedback is definitely useful too. This page collects various developer information how you can help, and how you can compile and extend the game's code and data.

All questions, feedback, etc. may be posted to vrmlengine-main mailing list.

Of course, any help with designing levels, items, monsters, creating sounds and / or providing significant feedback will be mentioned in the credits list and in-game credits dialog. You want some fame and fortune ? We got it.

Contents:

  1. TODO things
  2. Feedback
  3. Creating 3d objects
    1. 3D model formats
    2. Debug menu, debug options
    3. Levels
    4. Items
    5. Creatures
    6. Advanced effects
  4. Creating sounds
  5. Compiling
  6. Game goals
  7. Some implementation notes (interesting only for programmers probably)

TODO things

Most important TODOs for now are:

More detailed list is inside game archive in TODO file.

Feedback

Any kind of feedback will be useful. This includes:

Creating 3d objects

Below I describe how you can create new levels, items or monsters for this game. This requires at least some knowledge of a 3d modelling program (I use Blender). Depending on what exactly you will want to do, this may also require some programming knowledge — of course I will help here, which means that you can just design 3d model and tell me what it's supposed to do in the game (e.g. if it's an item then what happens when player uses it ?), and I will write appropriate code.

You don't have to make all images, textures, 3d parts yourself — you can freely use things available on the Internet. Just be sure that what you take is available on GNU General Public License (or anything that can be treated like a super-set of GNU GPL, like LGPL or public domain), as I will want to include this in the game licensed on GNU GPL. For a list of various sites with useful programs and collections of textures etc. see

3D model formats

The short 1-sentence introduction is: you can use any 3D modelling program able to create VRML 1.0 or 2.0 (aka 97) files.

VRML 1.0 and 2.0 formats have official specifications and our engine is capable of handling any VRML 1.0 valid files and most VRML 2.0 files (actually, even more than that). So the engine is not tied to any particular modelling program. Use view3dscene to view the various models outside of the game.

You may want to view in view3dscene some of the models from Kambi VRML test suite — there are many testcases and demos of what can be expressed in VRML 1.0 and 2.0 and what our engine can understand and render.

My favourite 3d modeller is Blender. It's open source, it's available for Linux (yeah, Windows too if you insist :), and it has an enormous set of features. Including good export for VRML 1.0 and 2.0, of course. Basically there are no special rules for designing in Blender models for our engine — just do whatever you like (and whatever can be exported to VRML 1.0 or 2.0).

The engine also handles perfectly VRML files exported from 3ds Max. So you can use 3ds Max to make models too. Also VRMLs produced by open-source modeller Art of Illusion are perfect. I suspect that all significant 3D modelling tools are able to export decently to VRML, so you can probably use any modeller you like. (This was one of the reasons that I chose VRML format as my basic format — it's nice to see that it pays off :) ). Note that I'd like to make the game using as much open-source tools as possible, so using open-source modeller is strongly favored over proprietary modellers.

Some detailed hints / tricks:

Debug menu, debug options

If you want to modify game content heavily, I advice to get familiar with our debug menu. The debug menu contains many useful commands that will make your life much easier. By default, debug menu is activated by backquote key (the one with tilde, the same key used to bring console in many FPS games).

Using the debug menu you can turn on some special features useful for designers/debugging (e.g. to see bounding volumes of objects) or turn off normal game features that may be annoying when designing (e.g. stop time for creatures).

You can also request a reload of particular creature/item/level VRML/XML etc. files. This is extremely useful when you changed some data file and you would like to quickly reload just this one file, to see how things work now — without exiting the game.

There are also some command-line debug options (but not too much — it's always more flexible to have things available at runtime instead of only at the start). Run the program with --help to get their list. --debug-no-creatures is one such useful option: it avoids this lengthy "Loading creatures" loading time, which is useful when you're not interested in testing creatures (e.g. when you only design new level geometry).

Levels

Items

Creatures

Advanced effects

As a final note, our engine supports some nice graphic features, and you may want to use them to make your models nicer. Some of the more important eye-candy features are:

Creating sounds

I need sounds (effects and music) for my game. If you can produce good sounds — send them to me.

If you cannot make your own sounds but you're willing to spend some time just finding the sounds on the Internet, that's also great. There are many places from where you can download free sounds on the Internet (so many that it actually takes some time to find the good sounds). So your help here is welcomed as well. (Still, remember that sounds have to be available under GNU GPL or some super-set of it, like LGPL or public domain.) Some useful links to start searching for sounds can be found at "Where do you get your sounds and samples ?" thread on PGD. In particular

What sounds are wanted ?

Notes about sound files:

Compiling

Download game sources. You will also need Kambi VRML game engine sources, unpack them in such way that kambi_vrml_game_engine/ and castle/ directories are together within the same directory.

Then compile inside castle/ directory by simple

  make build-unix
under Unixes (Linux, FreeBSD, Mac OS X) or
  make build-windows
under Windows. Note that you must use GNU make. Required compiler is FreePascal (you can look at notes about FPC version required — usually this is "latest stable FPC version"). There is no Delphi support — I live in the open source world.

Old notes for compiling with FPC <= 2.0.4 :

Sometimes FPC 2.0.4 fails with Fatal: Internal error 200310221. This is a bug in FPC 2.0.4, fixed since a long time in trunk 2.1.1 and later. I don't know the exact cause of it, but it has something to do with FPC 2.0.4 inability to handle unit dependencies in "The Castle" (no, there are no circular interface dependencies, but still there is something that confuses FPC 2.0.4). The workaround was usually to do make clean before each compilation (so that each FPC run starts from a "clean" state and has to recompile all castle units), fortunately FPC is so fast that this wasn't a big problem. Sometimes also retrying the compilation (i.e. without make clean) pushed it to "move forward".

Best workaround is of course to upgrade to FPC 2.2.0. I don't plan to keep FPC 2.0.4 compilation supported much longer, now that stable FPC 2.2.0 is released.

Before you run the compiled executable, make sure that it's properly installed: Unix users should make sure that symlink $HOME/.castle.data is appropriate (you can easily make this symlink by make install). And on all OSes make sure that you have the appropriate libraries installed. Windows developers may be comfortable with simply copying appropriate DLL files from precompiled version of the game, or download and use these DLLs (622 KB).

In the game sources archive I include all the sources needed to compile the game. Also everything needed to tweak with various parts of the game (e.g. GIMP *.xcf files, that are the "source" version of *.png images, and Blender's *.blend files that are the "source" version of some *.wrl files).

Everything is open source, GNU GPL.

Game goals

Below are some long-term plans. The game I'm dreaming about here is something like "The Castle 2.0", or even "The Castle 3.0", and probably will not be actually named "The Castle" anymore. Still, technically it will be "The Castle" continuation, based on next-generation of our VRML engine.

I feel obligated here to say what exactly this game is going to be. So beware, I'm going to be dreaming in the next paragraph.

Basically the game is intended to be like FPS but with some nice storyline. This also means that it should feel more like RPG (in more-or-less fantasy setting) — large world, many items, weapons, some character stats and levels etc. Also I want to utilize my engine to make levels more "interactive" — some objects on the level are able to move etc. There are many such games, some very old, some quite new. I'm just going to do this once again, in the way I want, and make it really good :)

Now, going back to reality: for PGD competition, no storyline, no real character stats were done (player has just Life and MaxLife — that's it), and the world is small (3 levels) and there are not so many items and creatures (as of 0.6.2 version, there are 5 creatures and 7 items). Basically my intention for PGD compo was to do something like "Quake, but with more short-range weapons and only 3-4 levels". (yeah, very innovative, I know :).

As for the development style — this game is developed fully open-source (including the game data). Part of the game sources is a general-purpose 3D game engine (I used it already to make small games and tools like malfunction, lets_take_a_walk and view3dscene). Everything should run on any modern OS/processor supported by FreePascal compiler, see Kambi VRML game engine for exact listing (if you want to port it to other system, you're welcome to provide the patches and compiled binaries). And I'm trying to do all game data using open-source things, most important here is Blender used to make all the models (see credits page for full list of things and resources used).

Some implementation notes (interesting only for programmers probably)

Collisions: