Castle Game Engine on Raspberry Pi

Posted on

New Raspberry Pi in Michalis hands :)
The Unholy Society ( ) on Raspberry Pi
The Unholy Society ( ) on Raspberry Pi

Recently I got my Raspberry Pi 4 device, and I am excited by the possibilities (small+cheap device with fully functional Linux). I was happy to see that Castle Game Engine runs perfectly on it 🙂 Here are some screenshots of The Unholy Society running on Raspberry Pi.

If you’re interested in using CGE on Raspberry Pi:

  • Just install FPC using the package repository (apt-get install fpc)
  • Get CGE source code

  • Build CGE build tool running castle_game_engine/tools/build-tool/

  • Build your application as usual, running castle-engine compile.

  • Raspberry Pi is just Linux OS + ARM CPU, rendering using OpenGLES. Everything just works, no surprises 🙂

  • It should also be possible to run Lazarus and CGE editor, although I didn’t do it yet.

  • Note that the default backend uses X. It is also possible to get CastleWindow backend using DispmanX (without X), although it is not yet merged into latest CGE.

Have fun with CGE on all your devices!

Comments on the forum ➤

Streaming sound tracks, FMOD linking improved

Posted on

Castle Game Engine logo with title
  1. Our sound engine now supports streaming sounds.

    “Streaming” means that we decompress the sound (like OggVorbis) during playback, in parts (as needed). This technique allows much faster sound loading (loading sound as “streamed” is almost instant). It adds a small run-time overhead to playing given sound, although in practice it is not noticeable at all, even on mobile devices (where the benefits — much faster loading — will be very noticeable 🙂 ).

    In general case, I advise to use it for longer sounds (like music tracks).

    The default remains to load sounds “complete”, just like before.

    To use this feature, call LoadBuffer method with slStreaming or use <sound ... stream="true" /> in sounds XML file. See the manual about sound for general information how to play sounds, including LoadBuffer and sounds XML files. An example is in our play_sounds example, just uncomment proper lines in gamestatemain.pas and CastleEngineManifest.xml (search for “streaming”).

    This feature works with both OpenAL and FMOD sound backends.

    Thousand thanks for implementing this feature go to Andrzej Kilijański!

  2. FMOD dynamic loading is now improved, which is particularly useful for Linux users.

    • The FMOD library no longed needs to be present at compile-time on Linux, it only needs to be present at run-time. You no longer need to pass -k-L... to FPC to link with FMOD.

    • If the FMOD library is not present at run-time, we make a warning (in log) and continue using existing backend. In effect, you can have the application use FMOD if possible, but fallback on OpenAL. This applies to all platforms using dynamic loading of FMOD, like Windows and Linux.

    • It fixes problems with linking with FMOD using GNU binutils 2.32 (like in Debian
      Testing). The linker was previously reporting errors bad value.

Comments on the forum ➤

ASTC texture compression, progress of engine Delphi compatibility

Posted on

Car exported from Blender 2.8 as Wavefront OBJ
  1. Castle Game Engine now supports ASTC, which is a great GPU compresion method available on most modern mobile devices (Android and iOS). You can easily compress your textures, and then use them at runtime, using the appropriate declaration in material_properties.xml file.

    The usage is described in details in ASTC compression support added to Castle Game Engine (also available in Polish) article by Andrzej Kilijański, who implemented this feature. Thousand thanks!

  2. I pushed Delphi compatibility further. Many more units are supported, in particular our file reading/writing/searching system using URLs, including our XML support (used throughout the engine). To have uniform XML support, I introduced Delphi units DOM, XMLRead, XMLWrite that wrap Delphi XML implementation (using MSXML and COM interfaces) in an API compatible with analogous FPC units.

    It all can be tested by compiling Delphi example in CGE sources. I hope to make more progress very soon 🙂

P.S. More cool stuff from Andrzej is coming — streaming music 🙂

P.P.S. Blender 2.8 was released! Note that CGE supports various 3D model formats supported by Blender 2.8 out-of-the-box (Wavefront OBJ, glTF 2.0, X3D, Collada, STL). (Unfortunately, exporting to the best formats — glTF and X3D — is far from perfect now in Blender 2.8. E.g. glTF exporter doesn’t apply modifiers, materials remain gray, transformation hierarchy has duplicated nodes. And X3D exporter can crash. As a workaround, OBJ exporter always works 🙂 )

Comments on the forum ➤