Oculus (VR) (we have the hardware to test)
WebGL (FPC can compile to WebAssembly)
XBox (we have the hardware to test).
Truly cross-platform, you can work on (almost) any platform and compile to any platform.
Console (Nintendo Switch).
Raspberry Pi (it’s just desktop Linux on Arm CPU).
Coming soon (roadmap):
The engine code is portable and in principle "just works" on any operating system and CPU supported by FPC or Delphi.
Editor to visually design your game 3D and 2D world and user interface around it.
With templates for new projects — empty, 3D, 2D. They showcase nicely engine possibilities and were designed as a good starting point for your applications.
Allows to easily build the project for all platforms.
With file browser, with preview for data (3D models, images, sound files).
With easy way to execute code editor (Lazarus, Visual Studio Code or anything else you like) to edit your code.
Designs are (de)serialized to JSON. Any component can be (de)serialized, along with it published properties.
You can define custom project-specific components available in the editor.
Viewport with scenes, camera, navigation allows to define 3D and 2D worlds.
Flexible hierarchy of transformations and scenes that you can design in the editor or control from Pascal code using a powerful OOP API.
TCastleScene to load and render a lot of model formats, like glTF, X3D, sprite sheets.
Flexible camera support, with multiple camera possible, attaching children to camera and placing camera as child of other objects, like bones.
Easy navigation components if you want to allow user to navigate in 3D or 2D worlds in a standard fashion. These include typical 2D and 3D navigation methods (like
TCastle2DNavigation) as well as 3rd-person navigation with avatar (
Each transformation can be enhanced with behaviors (descendants of
TCastleSoundSource. It is easy and encouraged to create behaviors required for your specific game, see Behaviors in the manual.
TCastleTransformReference to efficiently reference the same transformation multiple times. Great e.g. to instantiate thousands of trees.
Components to visualize terrains (
TCastleTerrain), and generate terrain data from smooth noise (
TCastleTerrainNoise) or image (
TCastleTerrainImage) or a combination of them (
TCastleTerrainCombine). See the examples/terrain.
TCastleViewport is a 2D user interface control that you can naturally use multiple times, to observe the same or different 3D / 2D worlds from different cameras at the same time.
We support standard model format from Khronos: glTF.
We support standard model format from Web3D: X3D and VRML.
Support for X3D 4.0 with Physically Based Rendering and lots of possibilities for shapes, textures, animations etc.
You can build and process scene graph of X3D nodes. Procedural generation of models, any pre/post-processing of models is possible.
You can write model conversion utilities. Our view3dscene allows to convert various models to X3D.
We support sprite sheets.
We support Spine skeletal 2D animations.
We have own Spine importer in Castle Game Engine that reads Spine JSON (not relying on any official Spine runtime).
Spine animations and rendering features are converted to standard engine animation nodes (same nodes as used by glTF and X3D) so they play consistently within the engine, with animation cross-fading etc.
Spine skins are suported.
Loading Spine JSON files from various Spine versions, up to and including Spine 4, is supported.
Spine texture atlases with all advanced options (e.g. stripping whitespace, rotating) are suported.
Alternative: Spine runtime for Castle Game Engine is an alternative approach to load and render Spine models. It supports some additional features by "offloading" some work to the Spine C runtime.
Compositing shaders to define shader effects that enhance existing engine rendering. See examples/viewport_and_scenes/shader_effects example. You can write own effects easily using OpenGL Shading Language.
Bump mapping (normal maps) using basic, parallax, steep parallax with self-shadowing algorithms.
Physically-Based Rendering used by default for glTF and X3D 4.0 models using
Alternative unlit shading also available, with glTF and X3D 4.0 models using
Shadow maps (with auto-detection of limits, correct shadows from multiple light sources).
Shadow volumes (with z-fail / z-pass automatic detection, silhouette detection).
Screen effects (post-processing) API to define post-processing effects using shaders. See screen effects specification, you can add screen effects over any UI control: just place it as child of
TCastleScreenEffects. See examples/screen_effects_demo/.
Multi-sampling (full-screen anti-aliasing), just set
Occlusion Query can greatly speed-up rendering in certain cases.
Easily display display images as user interface or in a viewport.
User interface library providing cross-platform UI controls that work on all platforms, like buttons, labels, images.
Their look can be adjusted to match the style of your game.
Automatic UI scaling to adjust to any screen resolution and aspect ratio with anchors.
Localization (including automatically translating user interface and
UTF-8 support for all strings through the engine API, in particular to render text.
The engine uses URLs, allows to download contents of URLs, and can be integrated with various networking libraries.
We have extensive optimization documentation and a number of features to help you make your game faster.
You can play sound, spatial (in 3D) or not.
Sound streaming is done, for efficient playback of music tracks.
WAV and OggVorbis file formats are supported with all sound backends.
Automatic sound source management based on priorities.
You can use physics.
Define rigid bodies and colliders on your objects.
Allow gravity and collisions to automatically have an effect.
Register events on collisions or triggers.
We use Kraft Physics Engine under the hood.
You can perform easily collision queries to determine… whatever you need. Just set
TCastleSceneCore.Spatial to at least
[ssDynamicCollisions] to make collision queries treat your scene as more than just a bounding box. Then use routines like
Viewport.Items.WorldBoxCollision to query whether something collides. Note that this, as of now, does not use the "proper" physics engine (like Kraft or planned Bullet), instead it uses custom octree implementation, but this will change in the future.
You can design game maps using Tiled.
Tiled maps (TMX files) can be loaded into
TCastleTiledMapControl for 2D display.
Or they can be loaded (work in progress) into
TCastleScene for 3D display and easy integration with other scenes on top of it, like sprite sheets for units on the map.
See examples/tiled/strategy_game_demo for a complete strategy game in CGE using Tiled maps.
Particle systems are not yet part of the core Castle Game Engine units. However you can use additional open-source components that add this capability to the engine:
Particle Emitter: Particle system for 3D and 2D that supports editing right inside CGE editor. Particles are calculated with GPU acceleration (transform feedback). By Trung Le (Kagamma).
The engine, as well as your games, are written using modern Object Pascal.
Pascal as a programming language is
elegant (type-safe, OOP, generics),
full-featured (big existing codebases can be used, e.g. Pascal and C, C++ libraries to connect your games with database, AI, networking),
native (compiled to native code that runs fast out-of-the-box).
To interact with a library using C++ classes (and other features that only C++ compilers understand) you generally need to write a "wrapper" library that exposes the equivalent API in plain C. This is exactly the same as trying to use C++ library e.g. from C#.
The same programming language that is used to make the engine is used for your applications — this results in simplicity (it’s easy to contribute) and speed.
Fast execution. It’s a language that compiles to fast native code, while staying elegant and type-safe.
Native debugging. It’s just a native application using native debugger. Debugging is integral part of the Lazarus IDE.
Build tool to manage your project from the command-line or in batch mode (good for continuous integration). The build tool, just like editor, reads project information from CastleEngineManifest.xml file.
Build tool can build, package, run your application and autogenerate compressed textures (and more).
We can build ready applications, like APK / AAB for Android, IPA for iOS.
Docker image with CGE and prerequisites (FPC, Android build tools, texture processing tools) to easily build CGE applications.
Ready instructions to automatically build CGE projects using:
Enjoy modern continuous integration, for free, however you host your code!
The engine is licensed on "LGPL with static linking exception" license, similar to FPC and Lazarus standard libraries.
In short it means that you can create commercial closed-source applications with it without any issues.
See license for details.
To improve this documentation just edit the source of this page in AsciiDoctor (simple wiki-like syntax) and create a pull request to Castle Game Engine WWW (cge-www) repository.