Big improvements to camera API coming soon, and check out our game on Nintendo Switch

Posted on

"Escape from the Universe" space map
  1. If you have Nintendo Switch console, by sure to check out Escape from the Universe on Nintendo Switch, a game released last month by Cat-astrophe Games.

    The game uses our Castle Game Engine for everything, of course. It depends on CGE Nintendo Switch support. A Japanese version of the game is also coming, using CGE UI localization system.

  2. I’m working on a big refactor of camera and navigation API in the engine. It is not merged yet, but you can see the in-progress work in camera-refactor branch (or see the differences from master branch).

    The current API of camera has a few drawbacks that the refactor addresses:

    • Current camera settings (“what do you see in a viewport”) are mixed with navigation logic (“how do you use keyboard/mouse to change the camera”). They are mixed within the TCamera class, and this causes various headaches when setting or auto-detecting them. All games need the same camera API, but various games need wildly different navigation logic. Many games want to just “roll their own” navigation code.

      This is addressed in the new branch, by splitting into SceneManager.Camera and SceneManager.Navigation instances. The mechanism to auto-detect their settings (based on scene bounding box, X3D nodes etc.) can be now easily disabled by SceneManager.AutoDetectCamera and SceneManager.AutoDetectNavigation .

    • Currently SceneManager.Camera may not be created before the first rendering, which is not comfortable. It causes the need for methods like SceneManager.RequiredCamera or checking SceneManager.Camera <> nil.

      In the new branch, it’s simpler. The SceneManager.Camera is never nil. In contrast, SceneManager.Navigation may be nil, and it may even remain nil forever, unless you want to use some built-in navigation logic.

    • Changing projection parameters using SceneManager.OnProjection is not comfortable. Changing projection parameters using CGE editor was not possible.

      In the new branch, you can just use SceneManager.Camera.ProjectionXxx parameters. It’s natural both in code, and in CGE editor.

    • Ideally, the class TCastle2DSceneManager should be deprecated and later removed. It should be trivially easy to get the same effect (orthographic camera, projection API comfortable for 2D games) with the base TCastleSceneManager.

    • I want to create an easy class for 3rd-person navigation. This means that input drives some character, while camera follows this character. This was requested by Robert Daniel Murphy on Patreon.

    Stay tuned for more information about this:)

Comments on the forum ➤

ImageBackground node, Android SDK version bump to 28, Andrzej articles about monotonic clock on Android, FPC 3.3.1 updates

Posted on

background_image_animated_0
background_image_0
  1. We have implemented a new X3D node ImageBackground (see the documentation). It allows to define a background using a simple image, and may be useful to view3dscene users.

    Demos are inside demo-models: background/background_image.x3dv, background/background_image_partial.x3dv, background/background_image_animated.x3d .

    It is compatible with InstantReality.

    Note that programmers using Castle Game Engine have already more powerful ways of defining a background :), e.g. you can use TCastleSceneManager.Transparent := true and then place any UI control underneath the scene manager.

  2. We have updated the Android SDK API level to 28, following Google requirements. Along with it, various services on Android versions were bumped. Also our Docker image was updated to include the proper tools already downloaded.

    Thanks go to Andrzej Kilijański for doing this!

  3. More articles about Castle Game Engine are available at Andrzej Kilijański site. In particular read about:

  4. We have updated small bits in CGE code and build tool to account for the latest Free Pascal Compiler 3.3.1 behaviour (fixed iOS and Nintendo Switch using FPC linkXXX.res files, avoid a flood of warnings caused by new FPC “case” completeness analysis). Also FPC version inside our Docker image was updated.

Comments on the forum ➤