Castle Game Engine is a free, open-source Object Pascal game engine. It supports both 3D and 2D games. You can make games for desktop (Windows, Linux, macOS), mobile devices (Android, iOS) and consoles (Nintendo Switch). But which version should I use?
As the creator Michalis Kamburelis convinces, it is better to choose the beta version, which is also used in production in his studio. The stable 6.4 release is from 24 Feb 2018 and there is about 1700 commits to master since this release. Many things have been done.
Animation Blending
Thanks to this, we avoid a sudden jump from one animation to another, the effect is much nicer:
The usage is very simple. To start blending just change TPlayAnimationParameters.TransitionDuration to a value other than zero (usually values between 0.1 and 0.5 look good) and use TCastleSceneCore.PlayAnimation with TPlayAnimationParameters.
An example is available in examples/animations/play_animation.
Easily play animations backward
Just change the Forward argument of the PlayAnimation function or the field with the same name in the TPlayAnimationParameters class to false.
Other improvements in animations
New methods added:
- TCastleSceneCore.StopAnimation – stops the current animation (the one from the CurrentAnimation property)
- TCastleSceneCore.ResetAnimationState – resets the animation state
- TTimeSensorNode.Start, TTimeSensorNode.Stop – allows you to run multiple animations simultaneously in one scene. An example of use is in examples/animations/simultaneous_animations_one_scene
Visual editor
Movie presenting the editor:
In addition, the editor can be started with rebuilding for the current project from the castle-engine tool using the castle-engine editor command. How to add your own components can be read in the editor’s Readme.
User interface coordinates
All positions and sizes are now Single (in version 6.4 were Integer). TRectangle properties have been marked as deprecated and have been replaced by TFloatRectangle e.g.:
TCastleUserInterface.ScreenRect -> TCastleUserInterface.RenderRect.
Other improvements in user interfaces
The engine has a lot of optimizations and fixes related to the UI, the most important of them are:
- TCastleHorizontalGroup, TCastleVerticalGroup – to easily layout your controls horizontally or vertically
- TCastleCheckbox – checkbox control
- a lot of fixes in TCastleScrollView
- in TCastleEdit you can set Placeholder or PasswordChar
- improved internationalization
Rendering improvements
The engine has many changes including:
- “SeparateDiffuse” mode, allows to get a prettier lighting
- new class TCastleScreenEffects offers easier, and at the same time more flexible API to control screen effects, example available in examples/screen_effects_demo
- fixes in CommonSurfaceShader
- glTF 2.0 support
- new methods TCastle2DSceneManager.PositionTo2DWorld and TCastleSceneManager.PositionToWorldPlane have been added, to easily convert mouse/touch position into a position inside 3D/2D game world
- clipping planes works on GLES
The possibility of temporarily disabling physics
You can now instantly disable/enable physics by setting SceneManager.Items.EnablePhysics to false/true.
Basic collision handling in physics
Collisions can be checked in two ways:
- by getting a list of colliding TRigidBody objects from TRigidBody.GetCollidingTransforms, works like get_colliding_bodies() in Godot.
- by using OnCollisionEnter and OnCollisionExit events on TRigidBody, this is similar to Unity.
Simple example is in examples/physics/physics_2d_collisions directory of the engine.
Sound
LoopingChannel has been added for easy music playback. Alternatively, you can use now the FMOD backend instead of the default OpenAL.
Android
The project is now “integrated” and the build tool compiles the game for 32 and 64 bits by default. This will be required from August 2019 by the Google Play store.
The Admob module has been updated. Rewarded ads are available now, and more detailed feedback for full screen ads.
Summary
This list shows only the most important (in my opinion) changes. I think creating a new project with 6.4 has no sense, because moving to 6.6 will require a lot of work.
Installation of the beta version
Some new features presented above are not yet available from the beta package from the engine site. In my opinion, it is much better to get the master branch from the project repository and be up to date:)
If you use linux with NVidia proprietaty GPU drivers, remember to use fpc version 3.2 or trunk, I wrote more about it here.
Patreon
You can support the author of the engine on patreon.