Difference between revisions of "Castle Game Engine"

From Free Pascal wiki
(Many text changes to incorporate engine 4.0.0 features. Removed some text that duplicates tutorial. Add fps_game screenshot.)
Line 1: Line 1:
== Features ==
+
[http://castle-engine.sourceforge.net/ Castle Game Engine] is a cross-platform 3D game engine. We provide an easy and extensible API to create and manage 3D objects, with out-of-the-box levels, items, intelligent creatures and more. We support 3D models and animations in various formats, in particular [http://castle-engine.sourceforge.net/vrml_x3d.php very versatile VRML / X3D]. Many graphic features are available, like shadows, bump mapping, mirrors, screen effects, shaders.
  
[http://castle-engine.sourceforge.net/ Castle Game Engine] (previously "Kambi VRML game engine") allows you to render 3D models in various formats. In particular, support for [http://castle-engine.sourceforge.net/vrml_x3d.php VRML / X3D] format is very versatile. You can define animations, interactions, scripting, shaders and many more in VRML/X3D, so you get a quite capable 3D game engine in the end.
+
Rendering is done through OpenGL. You can use Lazarus TCastleControl component, so that engine rendering can be a part of your normal Lazarus form. We also provide TCastleWindow class, specialized in creating windows with OpenGL context for games (with optional menu bars and dialog boxes, all without the need for LCL).
  
Rendering is done through OpenGL. We can use OpenGL context initialized in any way, including Lazarus [[OpenGL|TOpenGLControl component]], our own TGLWindow class (which allows you to create windows with OpenGL context, menu bars and dialog boxes, completely without the LCL), or any other library capable of creating GL context (glut, SDL).
+
The engine is open-source --- the core engine may be used under GNU LGPL, with "static linking exception" like FPC RTL, so you can make both open- and closed-source games. Developed using a clean Object Pascal, for FPC/Lazarus.
  
The engine homepage is http://castle-engine.sourceforge.net/. In particular, [http://castle-engine.sourceforge.net/engine.php this page lists all the engine features].
+
[http://castle-engine.sourceforge.net/engine.php This page links to engine downloads, documentation and lists all the engine features is more detail].
  
The engine is open-source (the core engine may be used under GNU LGPL, with "static linking exception" like FPC RTL), developed in a nice object-oriented way, only for FPC/Lazarus. The engine is not dependent on LCL, Lazarus components are just comfortable "extras".
+
== Documentation ==
  
== Screenshot (VRML/X3D browser in Lazarus) ==
+
We have a lot of documentation about using the engine:
  
[[Image:kambi_vrml_browser.jpg]]
+
# [http://castle-engine.sourceforge.net/tutorial_intro.php Tutorial]
 +
# [http://castle-engine.sourceforge.net/tutorial_classes_overview.php Classes overview]
 +
# [http://castle-engine.sourceforge.net/creating_data_intro.php Guide to creating game data]
 +
# [http://castle-engine.sourceforge.net/apidoc/html/index.html API reference]
  
== Lazarus components ==
+
== Screenshots ==
  
Major components that you can drop on a form:
+
VRML/X3D browser in Lazarus:
# TCastleControl: descendant of the standard TOpenGLControl that makes it easy to add our engine 2D controls and 3D objects. Has a scene manager instance (as TCastleControl.SceneManager) that collects information about your whole 3D world.
 
# TCastleScene: loaded 3D model (that may contain animation etc.).
 
  
You just drop TCastleControl on the form, and call
+
[[Image:kambi_vrml_browser.jpg]]
 
 
<syntaxhighlight>Scene.Load(FileName);
 
Scene.Spatial := [ssRendering, ssDynamicCollisions]; // if you want collisions
 
Scene.ProcessEvents := true; // if you want animations and interaction
 
 
 
Control.SceneManager.MainScene := Scene;
 
Control.SceneManager.Items.Add(Scene);</syntaxhighlight>
 
 
 
and you're done. Animations work, rendering in OpenGL works, navigation and key/mouse sensors work, etc. For more advanced uses, you can add 2D controls to Control.Controls list, and more 3D objects to Control.SceneManager.Items.
 
  
To install Lazarus components, download the engine sources, and look in the "<tt>packages/</tt>" directory. You probably want to install packages <tt>castle_base.lpk</tt> and <tt>castle_components.lpk</tt>.
+
FPS example game:
  
For more examples, see the "<tt>examples</tt>" subdirectory in engine sources.  For an example VRML/X3D browser (and viewer for other 3D models) done with Lazarus, see the <tt>castle_game_engine/examples/lazarus/model_3d_viewer/</tt> directory.
+
[[Image:castle_game_engine_fps_game.jpg]]
Full [http://castle-engine.sourceforge.net/reference.php API reference] and more high-level [http://castle-engine.sourceforge.net/vrml_engine_doc.php documentation about VRML/X3D handling] are available.
 
  
 
Enjoy! Author: [[User:Michalis|Michalis Kamburelis]]
 
Enjoy! Author: [[User:Michalis|Michalis Kamburelis]]

Revision as of 08:02, 28 January 2013

Castle Game Engine is a cross-platform 3D game engine. We provide an easy and extensible API to create and manage 3D objects, with out-of-the-box levels, items, intelligent creatures and more. We support 3D models and animations in various formats, in particular very versatile VRML / X3D. Many graphic features are available, like shadows, bump mapping, mirrors, screen effects, shaders.

Rendering is done through OpenGL. You can use Lazarus TCastleControl component, so that engine rendering can be a part of your normal Lazarus form. We also provide TCastleWindow class, specialized in creating windows with OpenGL context for games (with optional menu bars and dialog boxes, all without the need for LCL).

The engine is open-source --- the core engine may be used under GNU LGPL, with "static linking exception" like FPC RTL, so you can make both open- and closed-source games. Developed using a clean Object Pascal, for FPC/Lazarus.

This page links to engine downloads, documentation and lists all the engine features is more detail.

Documentation

We have a lot of documentation about using the engine:

  1. Tutorial
  2. Classes overview
  3. Guide to creating game data
  4. API reference

Screenshots

VRML/X3D browser in Lazarus:

kambi vrml browser.jpg

FPS example game:

castle game engine fps game.jpg

Enjoy! Author: Michalis Kamburelis