May Engine Features – FMOD, warmup cache, FpMake and InstantFPC docs…

Posted on

"Escape from the Universe" boss fight with chromatic aberration effect

First of all, sorry for posting so seldom recently. At Cat-astrophe Games we have been working on our first title on Nintendo Switch, of course using CGE! Many of the new features described below are a result of that, and of course you can use them already, they are part of Castle Game Engine 6.5.

New features and notable bugfixes:

  1. New sound backend using FMOD. You can select it at runtime following our instructions. FMOD offers even more cross-platform capabilities than our default OpenAL, in particular FMOD supports also consoles like Nintendo Switch. FMOD also allows to load more sound formats (like mp3). In the future our integration should also allow you to use FMOD Studio and call FMOD events from code.
  2. material_properties.xml now allow to convert images to a particular format (independent of GPU compression or downscaling). This is useful when you e.g. want all images as DDS for performance reasons (DDS reading is fast, as there’s no extra decompression).

  3. “Warmup cache” element in CastleSettings.xml allows to preload some images or scenes. This means that you load them once, in Container.LoadSettings, and not later (e.g. at loading UI state from .castle-user-interface file).

  4. We have better FpMake installation instructions.

    On a related note, we have new demo scripts using InstantFPC: instant_fpc_test_list_pascal_files, instant_fpc_test_open_window. If you often find yourself writing shell scripts, I encourage you to try InstantFPC 🙂 Feel the power of Object Pascal and CGE, while following similar trivial workflow as when writing shell scripts — just write and execute.

  5. CGE editor improvements:

    • Viewing and editing vectors is now easier, as you don’t need to expand the subcomponent.
    • Double-click on a Pascal file opens it in Lazarus, with correct project.
  6. In your applications, you can use

    {$ifdef CASTLE_AUTO_GENERATED_RESOURCES} {$R castle-auto-generated-resources.res} {$endif}

    instead of previous

    {$ifdef MSWINDOWS} {$R automatic-windows-resources.res} {$endif}

    This has 2 advantages:

    1. CASTLE_AUTO_GENERATED_RESOURCES is only defined by the build tool, when it actually created the castle-auto-generated-resources.res. So e.g. compilation from Lazarus will still work seamlessly too (it will just not include resources).

    2. It’s more future proof, we may decide to use castle-auto-generated-resources.res on other platforms too in the future (since FPC resources are cross-platform). This could provide more general way to “embed” data in the application executable than current image-to-pascal, texture-font-to-pascal, file_to_pascal_string.

  7. New option <data exists="false" /> is possible in CastleEngineManifest.xml

  8. Other notable bugfixes:

    • Fixed tiLoading scaling (use Theme.LoadingImageForWindowHeight).
    • Fixed texture-font-to-pascal output.

Have a lot of fun with Castle Game Engine!

Comment on this post ➤