Skip to content

Latest commit

 

History

History
481 lines (372 loc) · 29.8 KB

File metadata and controls

481 lines (372 loc) · 29.8 KB

Features

Note
Not enough? Want more features? :) See our roadmap and support us on Patreon to make it happen!

Presentation

cge::highlights-slides[]

Summary

cge::features-summary[]

Cross-platform

Truly cross-platform, you can work on (almost) any platform and compile to any platform.

  • Desktop (Linux, Windows, macOS, FreeBSD). Just install the engine, compiler (like FPC) and run the application.

    cgeimg::block[impressive_castle_editor.png|3D game in editor,fps_game_2.png|3D game running]

    cgeimg::block[2d_demo_editor.png|2D game in editor,2d_demo_game.png|2D game running]

  • Mobile (Android, iOS) with numerous Android services and iOS services to integrate with platform-specific features.

    cgeimg::block[ iphone_dragon_squash.jpg|"Dragon Squash" on iOS (iPhone), iphone_escape.jpg|"Escape from the Universe" on iOS (iPhone) ]

  • Web. Using the FPC WebAssembly target and WebGL for rendering. You can distribute your application by just including it as part of your webpage. Any modern web browser, desktop or mobile, supports it.

    cgeimg::block[ web_0_play_animation.png|Web demo - Play animation, web_1_space_shooter.png|Web demo - Space shooter, web_5_platformer.png|Web demo - Platformer, web_7_tiled.png|Web demo - Strategy Game Using Tiled ]

  • Console (Nintendo Switch).

    cgeimg::block[nintendo_switch_3.jpg|"Escape from the Universe" on Nintendo Switch]

  • Raspberry Pi and Pine64 devices (it’s just a Linux on Arm (32-bit) or Aarch64 (64-bit) CPU).

    cgeimg::block[raspberry_pi_1.webp|Raspberry Pi,unholy_raspberry_1.webp|"The Unholy Society" on Raspberry Pi]

  • Coming soon (roadmap):

    • Oculus (VR) (we have the hardware to test)

    • XBox (we have the hardware — even devkit, though "developer mode" can also be activated on a retail version of Xbox).

  • The engine code is portable and in principle "just works" on any operating system and CPU supported by FPC or Delphi.

Visual editor

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.

    cgeimg::block[editor_new_project.png|New project templates in CGE editor]

  • Allows to easily build the project for all platforms.

    cgeimg::block[editor_platforms.png|Choose target platform,editor_formats.png|Choose package format]

  • With file browser, with preview for data (3D models, images, sound files).

  • With easy way to execute code editor (Visual Studio Code, Lazarus, Delphi or anything else you like) to edit your code.

    cgeimg::block[code_editor_lazarus.png|Lazarus to edit Pascal code,code_editor_vscode.png|Visual Studio Code to edit Pascal code]

  • Designs are (de)serialized to JSON. Any component can be (de)serialized, along with it published properties.

  • Designs can refer to each other using cgeref:TCastleTransformDesign[] or cgeref:TCastleDesign[], to use them like prefabs from other engines. See components to reuse a design in other designs.

  • You can define custom project-specific components available in the editor.

Viewport with scenes, camera, navigation and other components

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.

    cgeimg::block[viewport_3d_nice_view.png|Viewport with 3D design]

  • Powerful cgeref:TCastleScene[] to load and render a lot of model formats, like glTF, X3D, sprite sheets.

  • Other visible objects like cgeref:TCastleBox[], cgeref:TCastleSphere[], cgeref:TCastleText[], cgeref:TCastleImageTransform[]. Great also for quick prototyping 3D and 2D worlds.

  • 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 cgeref:TCastleWalkNavigation[], cgeref:TCastleExamineNavigation[], cgeref:TCastle2DNavigation[]) as well as 3rd-person navigation with avatar (cgeref:TCastleThirdPersonNavigation[]).

  • Each transformation can be enhanced with behaviors (descendants of cgeref:TCastleBehavior[]), like cgeref:TCastleBillboard[], cgeref:TCastleSoundSource[]. It is easy and encouraged to create behaviors required for your specific game, see Behaviors in the manual.

  • cgeref:TCastleTransformReference[] to efficiently reference the same transformation multiple times. Great e.g. to instantiate thousands of trees.

  • Lights using components cgeref:TCastlePointLight[], cgeref:TCastleDirectionalLight[], cgeref:TCastleSpotLight[]. See lighting in manual.

    cgeimg::block[editor_lights.png|Lights in Castle Game Engine editor]

  • Components to visualize terrains (cgeref:TCastleTerrain[]), and generate terrain data from smooth noise (cgeref:TCastleTerrainNoise[]) or image (cgeref:TCastleTerrainImage[]) or a combination of them (cgeref:TCastleTerrainCombine[]). See the examples/terrain.

    cgeimg::block[ terrain_component_1.png|Terrain with water and trees, terrain_component_2_size.png|Terrain larger with fog, terrain_component_image.png|Terrain with data from image, terrain_component_water.png|Water reflecting terrain, terrain_component_wireframe.png|Wireframe terrain with water rectangle ]

  • Our cgeref: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.

    cgeimg::block[ mountains_of_fire_screen_1.png|Mountains Of Fire - split-screen coop game, view3dscene_viewports.png|Multiple viewports with a DOOM level in Castle Model Viewer ]

Data formats

glTF

We support standard model format from Khronos: glTF.

cgeimg::block[ gltf_village_outlines.png|Village scene with outlines from Sketchfab\, https://sketchfab.com/3d-models/ftm-0970f30574d047b1976ba0aa6f2ef855 by Luis Fernandez\, https://sketchfab.com/luyssport, gltf_helmet.png|Helmet from glTF (sample from Khronos), sketchfab_invincible.png|Invincible - Mark Grayson (3D model rendered using Castle Game Engine)\, https://sketchfab.com/3d-models/invincible-mark-grayson-698c1106da924ab1a26392247e697f79 \, by ASideOfChidori, sketchfab_cars.png|Cars 3D models from Sketchfab\, https://sketchfab.com/3d-models/pony-cartoon-885d9f60b3a9429bb4077cfac5653cf9 Pony Cartoon by Slava Z.\, https://sketchfab.com/3d-models/free-1975-porsche-911-930-turbo-8568d9d14a994b9cae59499f0dbed21e 1975 Porsche 911 (930) Turbo by Karol Miklas ]

  • Great integration with Blender that can export to glTF.

  • Lots of glTF models on the Internet, e.g. on Sketchfab.

  • Skinned animation.

  • Physically Based Rendering.

  • Metadata support (which can come e.g. from Blender custom properties).

X3D

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.

  • The cgeref:TCastleScene[] is a set of X3D nodes. We implement extended set of X3D nodes.

  • You can build and process scene graph of X3D nodes. Procedural generation of models, any pre/post-processing of models is possible.

  • We can save the X3D graph back to file, in X3D or STL format, see cgeref:TCastleSceneCore.Save[], cgeref:SaveNode[].

  • You can write model conversion utilities. Our Castle Model Viewer allows to convert various models to X3D and STL. Conversion to glTF is coming.

Sprite sheets

We support sprite sheets.

  • In Castle Game Engine (.castle-sprite-sheet), Starling and Cocos2D formats.

  • Own sprite sheet editor to visually create sprite sheets from texture atlases.

    cgeimg::block[sprite_sheet_editor.png|Sprite Sheet Editor]

  • See the platformer example - complete platformer game using sprite sheets. Also released on itch.io.

    cgeimg::block[platformer.png|Platformer demo]

Spine

We support Spine skeletal 2D animations.

cgeimg::block[ dragon_spine.png|Dragon in Spine, dragon_0.png|Same dragon rendered by Castle Game Engine ]

  • 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 supported.

  • 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 supported.

  • 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.

Graphic effects

  • Shader effects to define effects using GLSL that enhance existing engine rendering. See many examples in examples/shaders/ subdirectory. You can write own effects easily using OpenGL Shading Language.

    cgeimg::block[ volumetric_animated_fog_all.png|Volumetric fog, barna29_nice_shadows.png|Real-time water with caustics\, reflections\, shadows ]

  • Bump mapping (normal maps) using basic, parallax, steep parallax with self-shadowing algorithms.

    cgeimg::block[ editor_bump_mapping_none.png|Box in editor (without bump mapping), editor_bump_mapping_parallax.png|Box in editor (with parallax bump mapping), bump_demo_leaf_nobump.png|Leaf (without bump mapping), bump_demo_leaf.png|Leaf (with bump mapping) ]

  • Animation blending/cross-fading (cgeref:TCastleSceneCore.DefaultAnimationTransition[], cgeref:TPlayAnimationParameters.TransitionDuration[]).

  • Easy mirrors on flat surfaces.

    cgeimg::block[ terrain_component_water.png|Water reflecting terrain, terrain_component_wireframe.png|Wireframe terrain with water rectangle ]

  • Easy mirrors on curved surfaces (using generated cubemaps).

  • Physically-Based Rendering used by default for glTF and X3D 4.0 models using cgeref:TPhysicalMaterialNode[].

  • Alternative unlit shading also available, with glTF and X3D 4.0 models using cgeref:TUnlitMaterialNode[].

  • Alternative "classic" Phong shading is also available using cgeref:TMaterialNode[] or cgeref:TCastleSceneLoadOptions.GltfPhongMaterials[].

  • Shadow maps (with auto-detection of limits, correct shadows from multiple light sources).

    cgeimg::block[ rhan_shrine_5_everything.png|Bump mapping and shadow maps from multiple light sources, lights_editor_shadow_maps.png|Lights editor on a scene with shadow maps, sunny_street_tree_hard.png|Close up shadows on the tree. Notice that leaves (modeled by alpha-test texture) also cast correct shadows. ]

  • Shadow volumes (with z-fail / z-pass automatic detection, silhouette detection).

    cgeimg::block[rift_2.png|Fixed-camera game]

  • 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 cgeref:TCastleScreenEffects[]. See examples/screen_effects_demo/.

    cgeimg::block[little_things_screen_7.png|"Little Things" game with screen effects]

  • Color Space (Gamma Correction).

  • Easily design background (with sky/ground gradients, skybox), fog.

  • Multi-sampling (full-screen anti-aliasing), just set cgeref:TCastleWindow.AntiAliasing[].

  • Occlusion Culling can greatly speed-up rendering in certain cases.

cgeimg::block[ rendered_texture_with_background.png|RenderedTexture, chinchilla_diffuse_prt.png|Precomputed Radiance Transfer ]

  • Modern approach to OpenGL and OpenGLES usage:

    • Using modern OpenGL (OpenGL 3.3 "core" profile).

    • Possibility to use ancient OpenGL (even 1.1) if we have to. To support ancient, buggy systems or virtual machines. See cgeref:TGLFeatures.RequestCapabilities[] for information how to test it.

    • We can leverage some OpenGL ES 3.0 features (for shadow maps, 3D textures, occlusion culling…​), but any OpenGL ES 2.0 system works.

    • On desktops we can use both OpenGL (default) and OpenGLES. On mobile, naturally only OpenGLES.

    • Easy OpenGL debugging (cgeref:TGLFeatures.Debug[] allows to get rich logs and exceptions from GL).

Images

Easily display display images as user interface or in a viewport.

User interface components

cgeimg::block[inspector_design.png|Inspector UI,ui_image.png|Images]

  • 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.

  • Your game is organized into views. Each view can have a design (created in editor) and an associated unit where you can handle various events, like a key press.

  • Automatic UI scaling to adjust to any screen resolution and aspect ratio with anchors.

  • Powerful masks: manual, API reference, example.

Text and fonts

  • Rendering text in user interface and in 3D, with customizable fonts.

  • Fonts can be loaded from common formats (like TTF or OTF, cgeref:TCastleFont[]) or images (cgeref:TCastleBitmapFont[]).

  • Localization (including automatically translating user interface and resourcestrings).

  • UTF-8 support for all strings through the engine API, in particular to render text.

Networking

The engine uses URLs, allows to download contents of URLs, and can be integrated with various networking libraries.

cgeimg::block[ delphi_linux_downloads.png|asynchronous_download example\, downloading multiple URLs asynchronously (without blocking the UI), not_quake_1.png|"Not Quake" demo - real-time network game, mormot_example_screenshot1.png|Collaborative editing of 3D world using Castle Game Engine and mORMot2, server_and_2_clients.png|TCP server and 2 clients\, on Windows ]

Optimization and profiling

We have extensive optimization documentation and a number of features to help you make your game faster.

  • Inspector available under F8 in any debug game shows FPS profile and much more. It allows to inspect the current properties of all components, to tweak them at run-time, and even to hot-reload assets at run-time.

  • Built-in simple profiler cgeref:TCastleProfiler[].

  • Built-in frame profiler cgeref:TCastleFrameProfiler[].

  • Built-in texture memory profiler cgeref:TextureMemoryProfiler[].

  • cgeref:DynamicBatching[] is available to batch multiple shapes, to conserve draw calls.

Sound

You can play sound, spatial (in 3D) or not.

cgeimg::block[ sound_example_3d_game_source.png|3D game sound demo - TCastleSoundSource ]

  • Supports for various sound backends: OpenAL or FMOD, on multiple platforms.

  • Sound streaming is done, for efficient playback of music tracks.

  • WAV and OggVorbis file formats are supported with all sound backends.

  • Sound components cgeref:TCastleSound[] and cgeref:TCastleSoundSource[] can be designed and tested also in editor.

  • Automatic sound source management based on priorities.

Physics

cgeimg::block[ physics_1.png|Bunch of physics rigid bodies, physics_mesh.png|Physics with mesh collider, physics_2d.png|Physics 2D ]

Use physics to calculate and react to collisions between objects.

  • Define rigid bodies and colliders on your objects. You can do it visually in the editor (and visualize colliders to make sure they make sense). Of course you can also set them up using code.

  • Allow gravity and collisions to automatically have an effect.

  • Test how physics behaves right inside the editor using "Physics Simulation" in editor.

  • React to collisions by registering events. Objects can also be "triggers" if you only want to detect when something enters their volume.

  • Set up joints that connect rigid bodies in some ways, e.g. to create a hinge.

  • Physics is fully useful in both 3D and 2D. Consult our examples (in examples/physics/) for demos.

  • Manually apply forces to affect rigid bodies using physics, e.g. to make a character jump, or cause an explosion.

  • Perform collision queries using physics, like "ray casts". Use e.g. cgeref:TCastleAbstractRootTransform.PhysicsRayCast[Viewport.Items.PhysicsRayCast].

  • Organize objects in layers to limit what collides with what.

  • Using Kraft Physics Engine under the hood.

  • Deprecated: We also feature an older system with (for now) a few more ways to query collisions. Just set cgeref:TCastleSceneCore.PreciseCollisions[] to true to make collision queries treat your scene as a precise mesh. Then use routines like cgeref:TCastleAbstractRootTransform.WorldRayCast[Viewport.Items.WorldRayCast] or cgeref:TCastleAbstractRootTransform.WorldBoxCollision[Viewport.Items.WorldBoxCollision] to query whether something collides.

Tiled integration

You can design game maps using Tiled.

cgeimg::block[ tiled_editor_snow.png|Tiled snow map (with animations), tiled_editor_beach.png|Tiled beach map (with animations), tiled_3.png|Tiled isometric map, tiled_strategy_hex.png|Tiled hexagonal map in "Strategy Game" demo, tiled_strategy_iso.png|Tiled isometric map in "Strategy Game" demo, tiled_strategy_ortho.png|Tiled orthogonal map in "Strategy Game" demo ]

  • Tiled maps (TMX files) can be loaded into cgeref:TCastleTiledMap[] for an efficient 2D or 3D display in a viewport.

  • Viewport display means they can be combined with other scenes on top of it, like sprite sheets for units on the map.

  • We support various map types (orthogonal, isometric, hexagonal), layers (you control which layers are displayed), animations and more.

  • See the manual about Tiled map.

  • See examples/tiled/strategy_game_demo for a complete strategy game in CGE using Tiled maps.

Data and Systems

Developing games means dealing a lot with data (assets). We have full-featured systems providing all the capabilities you need. They are the basis of our editor but are also useful at run-time to deal with your data while your application runs.

  • Automatic packaging of data files for all platforms, exposing them through castle-data:/ URL.

  • All the reading, writing, searching in our engine accepts URLs. So you can use regular file-system (file:/), you can refer to files in your data (castle-data:/), you can refer to resources inside ZIP files, or even resources on the network (https:/…​). You can easily register your own URL protocols (schemes) to extend this system.

  • ZIP handling, supporting read and write, supporting all platforms and compilers, with optional URL protocol registration. See cgeref:TCastleZip[] and news about ZIP.

  • Loading and saving components (our engine components or any other Pascal TComponent) to JSON files. The base unit to do this is cgeref:CastleComponentSerialize[], and there are many things build "on top" of it, like our editor, loading designs in views, reusing designs.

  • Cloning the components using cgeref:TCastleComponentFactory[], cgeref:ComponentClone[]. See e.g. examples/2d_games/space_shooter that uses a factory to spawn rockets and rocks.

Particles

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:

cgeimg::block[ particles_2.webp|Particles, particles_3.webp|Particles, particles_4.webp|Particles ]

  • 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).

    cgeimg::block[cge_3d_particles_editor.png|Particles editor]

  • Effekseer Integration: Integration with Effekseer, a full-featured open-source particle effect creation tool. Also by Trung Le (Kagamma).

    cgeimg::block[cge_effekseer.png|Effekseer Integration]

Native and fast code using modern Pascal

The engine, as well as your games, are written using modern Object Pascal.

cgeimg::block[combined_fpc_delphi.png|FPC\, Delphi\, Visual Studio Code]

  • We maintain a modern Object Pascal introduction book to learn the language and link to many more learning resources.

  • We support FPC and Delphi compilers, see Supported compilers and IDEs.

  • 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).

      Note

      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.

  • Fast compilation.

  • Native debugging. It’s just a native application using native debugger. Debugging is integral part of the Lazarus IDE.

Build tool and continuous integration

cgeimg::block[combined_osi_ci_logos_2.png|Open source\, Jenkins\, Docker\, Codeberg\, Woodpecker CI\, GitHub Actions\, GitLab CI]

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).

  • You can build for any supported target platform. You may need to install cross-compiler (e.g. using fpcupdeluxe), some platforms may also require additional tools (see their docs like Android).

  • 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!

Free open-source software

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 proprietary, closed-source, commercial applications with it without any issues.

  • See license for details.