Two new services are now available on Android:
Shadow maps work on OpenGLES (Android and iOS) now!
The Android building tools, which are part of our build tool, were updated. We use a new version of Gradle and Android Gradle Plugin under the hood, and by default we compile using Android platform 27. The minimal supported Android version is lower of course — it is 16 (Android 4.1), Android NDK doesn’t support older versions now.
You can now build an APK for 64-bit version of Android, which will be required by the Google Play store since August 2019. Use our build tool to compile an APK with both 32-bit and 64-bit variants (for best compatibility):
castle-engine package --target=android. Alternatively, you can build a 64-bit-only APK with
castle-engine package --os=android --cpu=aarch64. This requires FPC 3.3.1 with Android/Aarch64 cross-compiler.
The default project type is now “integrated”, which allows to define various services and also automatically adds OpenAL (sounds), Tremolo (OggVorbis reading), FreeType (font file reading) libraries to your Android project, if they seem necessary (if your data files contain some sound files, .ogg, .ttf etc. files).
A couple of bugfixes to Android building were applied. We now use Android NDK platform 16 (for 32-bit builds), not newer, to really work even on Android 4.1. We fixed FreeType usage (so that it works even on older Android devices). And we improved the documentation how to setup your Android SDK/NDK environment.
Because people will read again, I improved various parts of our documentation:
New page about using
CastleSettings.xmlto easily configure UI scaling and default font, in a way that can be applied in game as well as in the CGE editor.
Our Coding Conventions (and some related notes about contributing code to the engine) are now on our wiki. It’s long, so here’s a short version: write a code that is good (as simple as possible) and submit a pull request on GitHub.
Large updates to our “planned features” page. A lot of stuff was done, or partially done, during the development of the upcoming CGE version 6.6. And a lot of new stuff is planned 🙂
Valter Buccina made a demo application using sprites in Castle Game Engine.
The demo is available on https://github.com/valterb/sprite-demo-castle-engine.
Citing from the README:
Demo is divided into two parts:
- Road demo
The first shows with extreme precision the direction of the sprite in degrees. Using mouse click coordinates and Player position we apply the arctangent formula and convert the value obtained in degrees. This way we get the requested direction.
The second one is a demo with a road background where you can move the sprite that is sized according to the distance from the observation point. One click to walk, double click to run. Run animation is divided into three actions, short initial walk, run, short final walk but it is not perfect.
New Appearance.alphaChannel field (
TAppearanceNode.AlphaChannelin Pascal) determines alpha channel treatment when rendering a shape with given appearance. We can use alpha testing, alpha blending, or ignore the alpha channel (render as opaque).
This field overrides the engine auto-detection “how to treat alpha”, which normally looks at
Material.trasparentand the alpha channels of textures (which can, in turn, be affected by ImageTexture.alphaChannel). If you set
Appearance.alphaChannelto something other than
"AUTO"then we avoid any auto-detection, and we just render according to this field.
This corresponds to glTF
New utility methods TCastle2DSceneManager.PositionTo2DWorld and TCastleSceneManager.PositionToWorldPlane have been added, to easily convert mouse/touch position into a position inside 3D/2D game world.
Our example 2d_dragon_spine_game inside CGE sources demonstrates this, using
SceneManager.PositionToWorldPlaneto determine target position of the dragon. Also, this example now demonstrates animation blending.
glTF texture can be converted to a
MovieTexture. If your texture URL is like .avi or .mpg, we will automatically load it as
MovieTexturein X3D, and it will actually play in a loop (if you have ffmpeg installed).
We have a new Castle Game Engine forum: https://forum.castle-engine.io/ .
It is using an open-source Discourse platform. It should be significantly better than the old forum 🙂
- The font rendering behaves better when the text contains a character that we cannot render: it displays a fallback glyph (usually “?”) and makes a warning (using
WritelnWarning, so it goes to log). This allows to easily spot missing characters in the font and makes backspace working sensibly if you input a character which glyph isn’t supported.
You can toggle this by setting TTextureFont.FontData.UseFallbackGlyph to
TCustomizedFont.Load allows to load font texture in a couple of alternative sizes. The resulting font rendering will look better, it will use the best texture, and thus can look crisp regardless of the final size on screen.
It is very easy to use this feature by CastleSettings.xml. Simply define a
default_fontand instead of
size_at_load="20"use something like
sizes_at_load="10 20 30".
TCastleScrollViewManual allows to have a scrollbar that controls… well, anything you want (handling OnChange event). This is a more flexible version of TCastleScrollView that scrolls user interface inside.
The new controls and font rendering capabilities can be of course easily tested in CGE editor.
We have a Docker image that you can use to easily get Castle Game Engine along with prerequisites (like FPC with various cross-compilers): kambi/castle-engine-cloud-builds-tools image on Docker hub .
If you’re new to Docker, I wrote a nice description how to use Docker with CGE. Basically, instead of installing CGE, FPC, Android SDK/NDK… you can just get a Docker image.
(P.S. Wow, last 2 months were exhausting. I have a ton of news about CGE for you, and will publish them in the upcoming days 🙂 ).