Big engine plans for 2020, Trello boards, X3D PBR

Posted on

The Unholy Society - sister talk
Castle Game Engine editor with scene manager menu
Effects of dynamic batching
New Raspberry Pi in Michalis hands :)
Escape from the Universe - space map design
Escape from the Universe on Nintendo Switch - design
Castle Game Engine - strategy game demo - hexagonal Tiled map

As the 2019 is ending, it’s a good moment for a summary. What did we achieve, and what do we want in 2020?

  1. First of all, I’m very happy with a huge number of new engine features. This includes CGE visual editor, significant improvements to the important APIs (viewports, cameras, user interfaces), Nintendo Switch support, glTF support.

    This leads me also to our most critical TODO for 2020: We really need to release the next CGE version 7.0, as a “stable” version. Yes, it will be called 7.0 (not just 6.6) — we have a number of new major features (and some unavoidable incompatible changes).

    The release-blocker now is making the “gizmos” to allow to comfortably transform TCastleTransform in the editor.

  2. I want to say enormous “thank you” to everyone who contributed to the engine in 2019, or made games using CGE. In particular big thank you goes to the Eugene Loza, Andrzej Kilijański and Kagamma for your pull requests and all the conversations.

    This point also leads me to another TODO: I want to manage our work better. We want to make the best open-source game engine, and I’m not going to stop until we get there 🙂 For this purpose, I created public Trello boards to manage CGE work. If you’d like to join CGE on Trello, just let me (Michalis) know. Everyone is invited.

    Note that Trello is not supposed to replace GitHub issues. GitHub is still great to submit bugs (issues) or PRs. But Trello may be better to organize tasks (by task here I mean ““something that needs to be done”, which isn’t always a bug, and some tasks have complicated dependencies — some tasks are blocked by other tasks, have subtasks etc.). I feel that Trello is great to manage such tasks.

  3. Technical most important features to implement in 2020:

    1. Delphi compatibility. You asked for it, and it’s started. It will open us to a whole new pool of engine users (and potential contributors).

    2. Support glTF skinned animations. glTF is becoming the de-facto standard for interchanging 3D animated models. We already support glTF, but we miss this important feature.

    3. Physically-Based Rendering. I’m leading the X3D 4.0 specification changes related to this. We want to finish the spec in January, and later implement PBR in CGE.

    That’s it, in summary. Of course I have more plans 🙂

Have the best 2020! Let’s make good code, and good games. We are open-source, we love writing code, we love telling stories, we love designing fun games. Let’s do it:)

Comments on the forum ➤

Last refactor before CGE 7.0 release: Say hello to TCastleViewport and TCastleWindowBase, say goodbye to TCastleSceneManager and TCastleWindow

Posted on


This week I finished the last big engine API change before the next release! TCastleSceneManager is now deprecated: instead you should use TCastleViewport to display 3D models. This makes things much simpler, and it allowed me to make TCastleViewport defaults much better.

1. TCastleViewport

A simplest working source code demonstrating this (it will compile — get the engine and test it!) looks like this:

uses SysUtils,
  CastleWindow, CastleSceneCore, CastleScene, CastleViewport, CastleCameras, CastleVectors;

  Window: TCastleWindowBase;
  Viewport: TCastleViewport;
  Scene: TCastleScene;
  Window := TCastleWindowBase.Create(Application);

  Viewport := TCastleViewport.Create(Application);
  Viewport.FullSize := true;
  Viewport.AutoCamera := true;
  Viewport.AutoNavigation := true;

  Scene := TCastleScene.Create(Application);

  Viewport.Items.MainScene := Scene;


See the CGE examples: 3d_rendering_processing/view_3d_model_basic.lpr for a complete code with some additional comments.

The advantages of the new approach:

  1. The API is simpler (easier to explain and use).

    Previously, TCastleViewport was in most practical cases reserved for “secondary viewport”, that shows something also visible in the “primary viewport”. The “primary viewport” was TCastleSceneManager with DefaultViewport = true. This entire complication (and complication of terminology – “how is scene manager different from viewport”) no longer exists.

    Now you just use TCastleViewport to display a world (composed from a tree of TCastleTransform and TCastleScene). Period.

    To display the same world from two cameras, just copy one TCastleViewport.Items to another. Or assign the same TCastleRootTransform instance to two TCastleViewport.Items.

    To have multiple viewports (cameras) display the same world, simply assign the Items property of one TCastleViewport to another. You can also create your own TCastleRootTransform instance and assign it to as many TCastleViewport.Items properties as you want. Demo of this is inside CGE examples: 3d_rendering_processing/multiple_viewports.lpr.

    So all previous use-cases are covered in a more natural way.

  2. Moreover, this allowed me to minimize compatibility break while still changing some defaults. Since TCastleViewport was so seldom used, we change it’s default properties:

    The FullSize=false default is consistent with all other UI controls. This way it is less surprising (when instantiating from code or in CGE editor).

    The AutoCamera=false and AutoNavigation=false are better defaults after recent camera refactor. The “false” default on these properties makes more sense — while the auto-detection is nice for quick demos, it is bothersome and sometimes surprising for non-trivial applications, so it’s best to have the auto-detection “off” by default.

    On TCastleSceneManager these defaults do not change (as it would undoubtedly cause a lot of breakage, since you use TCastleSceneManager so much in existing applications).

2. TCastleWindowBase, TCastleControlBase

Also TCastleWindow and TCastleControl are deprecated, in favour of their “Base” counterparts: TCastleWindowBase and TCastleControlBase. Why:

  • This way you don’t have a default viewport (scene manager) instance, which avoids some traps (the default navigation may catch some keys), and it is often not necessary.
  • This way you create the TCastleViewport yourself, as many as you need. So you have more power over the engine. This way it is clear that TCastleViewport is just a regular user-interface class: you can create it as many times as needed, you can position and resize it however you like.

  • This way you can create and adjust the TCastleViewport using CGE editor, just like any other UI control.

Many parts of the manual and examples have been updated to show “the new approach”. I’m working to finish updating the manual now.

Comments on the forum ➤

Bumpcars-2019 – gamejam racing game by Rafael Campos

Posted on


Rafael Campos submitted a new game using Castle Game Engine. Race against the clock to complete the three tracks: park, city and beach. In order to win you will must evade the obstacles and your competitors.

Download the game for free from!

This game was submitted to the game jam “I’m using a lot of assembly language” also hosted by Rafael. 50% of game code is assembler (14000 lines of ASM code), which main objective is the subdivision of 3D triangles.

By the way, I also reworked our Gallery, and added various missing entries. It is now split into:

Comments on the forum ➤

Engine improvements: GtkGLExt no longer used, new TCastleInspectorControl, loading optimizations, TwoSidedMaterial node

Posted on


November/December engine improvements:

Comments on the forum ➤

Bricks Color Pick – free Android game made using Castle Game Engine

Posted on


We’re proud to present a new game made using Castle Game Engine: Bricks Color Pick. It’s a new approach to the classic arkanoid games, with a twist: there is no paddle. The challenge is to switch the color of the ball to match the bricks. You need to do it quickly — because the ball will bounce all around the level using physics.

Made by Andrzej Kilijański who also wrote a lot of articles about Castle Game Engine. Andrzej also submitted a number of pull requests related to our physics support (based on Kraft) — and now we know why 🙂

Check out the game on your Android, it’s completely free!

Comments on the forum ➤