Various improvements: project caption in editor, castle_indy package, CThreads, etc.

Posted on

Castle Game Engine editor - New Project dialog

Various important improvements done lately in Castle Game Engine:

  1. You can set project caption when creating a new project in CGE editor.

  2. Our CastleClientServer unit (for TCP/IP networking) has been moved to a new Lazarus package castle_indy that depends on indylaz package. This makes our connection to Indy cleaner, and fixes the client/server example compilation. This entire section of the manual was also improved.

  3. CGE applications (if you let the build tool to auto-generate your program file) on Unix now by default use CThreads, thus they can use TThread.

    This affects desktop Unix platforms, like Linux and FreeBSD.

    This means that

    1. asynchronous downloading (TCastleDownload with http, https) and
    2. music streaming (SoundEngine.LoadBuffer(.., slStreaming) with default OpenAL backend)

    … just work out-of-the-box. I suspect that more and more such features will appear in the future, so it makes more sense to make the default “threads work on Unix”.

    If you would like to disable CThreads for some reason, you can still do it by compiling with CASTLE_DISABLE_THREADS.

    FPC by default doesn’t use CThreads, to avoid linking with C library, to increase compatibility across Linux distros. But, as far as my experience goes, this argument is no longer relevant in 2020. I haven’t actually encountered any case when a binary FPC application cannot be transferred from one Linux to another due to CThreads API incompatibility. Reading one recent FPC bugreport about it I can conclude that the fear of “linking to C by default” is now more because of “unforeseen consequences”, not because of any proven visible problem that can occur on Linux in 2020. And that report is about FPC_USE_LIBC, while using CThreads should be a smaller issue.

    And note that CGE uses a few libraries that definitely change more rapidly than C library anyway (e.g. libpng, X, GTK, OpenGL…).

  4. remote_logging example was redesigned:

    1. Should work on all platforms nicely now, doesn’t need console
    2. Shows nice UI with animation (to show that all HTTP stuff doesn’t cause any interruption in the main thread)

Start the discussion at Castle Game Engine Forum