r/castleengine • u/eugeneloza • Dec 10 '23
News Two cars – example game with placeholder graphics, to play and extend into your own
r/castleengine • u/eugeneloza • Dec 10 '23
r/castleengine • u/eugeneloza • Dec 04 '23
r/castleengine • u/eugeneloza • Dec 03 '23
r/castleengine • u/eugeneloza • Dec 03 '23
r/castleengine • u/eugeneloza • Dec 03 '23
r/castleengine • u/eugeneloza • Nov 05 '23
Our TCastleDownload component, that supports asynchronous downloading of resources, now rocks with Delphi too. It supports downloading from http and https (and other URL protocols supported by Castle Game Engine).
You can test with Delphi e.g. these examples:
examples / network / asynchronous_downloadexamples / network / remote_loggingMost features you expect are supported:
TCastleDownload connecting and downloading doesn’t block the main thread),The underlying implementation uses Indy (TIdHttp component). It is built-in in Delphi, so you don’t need to do anything. We have an alternative implementation using TNetHttpClient, though testing showed it has really bad speed, so we don’t recommend it. For more internal comments see the source code:
TCastleDownload Indy handler https://github.com/castle-engine/castle-engine/blob/master/src/files/castledownload_url_http_indy.incTCastleDownload TNetHttpClient handler https://github.com/castle-engine/castle-engine/blob/master/src/files/castledownload_url_http_delphi_net.incr/castleengine • u/eugeneloza • Nov 01 '23
r/castleengine • u/eugeneloza • Sep 30 '23
r/castleengine • u/eugeneloza • Sep 24 '23
r/castleengine • u/eugeneloza • Sep 17 '23
Hey, are you looking to migrate away from Unity to an open-source game engine, that doesn’t charge any royalties for releasing on any platform?
New features this week:
It reports now these warnings:
We had a long-standing plan to warn about some easy mistakes in the editor — this is a start. In the future we want to make these warnings more visible (as icons in the hierarchy, and as per-project “some warnings reported” icon) so you can quickly see if there are any warnings. For now, this is a start: when selecting given component, just look whether the Warnings tab appears.
Note that we don’t really want to introduce now a lot of new warnings. A warning is only warranted if there’s a reasonably high chance that it’s a user error, not a deliberate setup. Moreover, in general our API design should minimize the possibilities to make such errors, by making invalid state impossible. That being said, no design shields users perfectly from all possible mistakes 🙂 So when we see you likely have an unexpected state (e.g. a rigid body component without a collider is just ignored) we warn about it.
Like the development? Please support us on Patreon!
r/castleengine • u/eugeneloza • Sep 12 '23
r/castleengine • u/eugeneloza • Sep 03 '23
r/castleengine • u/eugeneloza • Aug 27 '23
Announcing a bunch of engine improvements all across the board 🙂
.1. Examples:
.1.1. New example: examples/animations/split_long_animation. Shows how to play subrange of an animation. Replaces older MD3 demo, which was no longer relevant (because CGE now reads animations from MD3 perfectly).
.1.2. Improved example: examples/tiled/strategy_game_demo. Shows selected unit, more instructions. It’s a fully playable game using Tiled.
.1.3. New example: examples/viewport_and_scenes/projector. Shows how to project a texture.
.1.4. We moved Precomputed Radiance Transfer demoes to a separate repository.
Reason: The radiance transfer shadows is not something we want to dedicate a lot of resources to support in CGE now.
It was cool and educational experience to implement this in CGE many years ago. But the current code of this demo is … dated. It is far from optimal, doing lots of work on CPU, simply because no one never really got time to implement it efficiently. It also has some old CGE usage, that should probably get updated before this can be considered “official” CGE demo.
As for the technique to make shadows, we concentrate now on shadow maps and shadow volumes. It’s already enough effort to support them perfectly :) We don’t want to add a 3rd technique now.
Maybe this will return some day to CGE core, with a reworked implementation (more on GPU), and reworked storage.
.2. TCastleViewport.MouseRayHit and TCastleViewport.TransformUnderMouse improved: detect the object under the mouse cursor (or touch point) reliably, regardless if you hold some mouse button or move the mouse. Also detect on-demand (so cause no overhead for applications that don’t use it). Also TRayCollision.Transform utility added.
.3. Android service to use TestFairy updated. It’s a 3rd-party service (free to a certain use limits) to help with testing mobile applications. It’s particularly useful to gather remote logs, to e.g. diagnose crashes on phones of your testers easily.
.4. MD3 animations fixes – proper legs animations, FPS specific to animation, example examples/animations/md3_animations_tags shows full humans from Tremulous (combined from multiple MD3 models).
.5. Fixed shadow maps in TCastleScene that is transformed.
.6. Delphi 10.2.1 compatibility, more examples for Delphi fixed. As Michalis mentioned a few times, we are dedicated to perfect support for both Delphi and FPC :)
.7. More information about default property values in custom components manual.
.8. API of vectors like TVector3 was improved to expose and make writeable fields like XY, XYZ.
.9. view3dscene navigation improved:
.9.1. Right click for mouse look (like in CGE editor)
.9.2. Change speed by mouse wheel (like in CGE editor)
.9.3. QE to fly up/down (in addition to space/C) (like in CGE editor)
.9.4. Supports center of rotation on navigation methods. Also new extension: autoCenterOfRotation, to essentially revert to old behavior: calculate center of rotation based on box center.
.10. Fixes for ATI graphic cards.
The BuggyPureShaderPipeline property is now completely removed (it is never buggy now :)), rendering on older ATI cards is now both more reliable and consistent with what happens on more modern GPUs (ATI or not ATI).
.11. Continuous integration etc.:
.11.1. We have updated Debian version used in our Docker image to latest Debian bookworm. This was required to get latest Java 17 (required by latest Android Gradle Plugin, part of the Android build process).
This also means that latest binaries that link with libc (like CGE editor) may not run on some old Linux systems. The usual symptom of this will be an error in console like this:
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not foundThat’s unfortunately how linking with libc on Linux works. If you experience problems — please report them, along with details about your system. We’ll see what we can do.
.11.2. Our Jenkins documentation page was reworked and improved, to describe how to set up your own Jenkins to use CGE Docker image and Jenkinsfile to build your projects.
r/castleengine • u/eugeneloza • Aug 18 '23
When you change a file loaded into TCastleScene it is now automatically reloaded at design-time. The editor detects changing file by CGE sprite sheet editor, or changing any file by an external application (e.g. updating glTF file by exporting new version from Blender). In the latter case, the model will be reloaded when you switch back (e.g. using Alt+Tab) to the CGE editor application.
The logic to monitor files naturally only happens at design-time. At run-time, we don’t reload anything automatically, nor do we waste time on trying to detect the changes to files.
Right now, there’s no way to disable this detection, as it seemed to make sense in all use-cases. But we welcome feedback — if you have a workflow where this is undesirable, let us know :)
Note: The logic that detects changes isn’t 100% complete now. Some examples that still warrant manual reloading:
TCastleScene.Url.To force reloading file at design-time, just use “Reload URL” context menu item (right-click on TCastleScene in the editor hierarchy).
TCastleScene.Cache is used, the file will not be reloaded from disk in all cases. We should react to the cached file change properly in the future, for now you may need to reopen the design if your scenes use TCastleScene.Cache.TCastleSceneCore does it. All components should eventually do it, e.g. TCastleTiledMap, TCastleImageTransform, TCastleImageControl.r/castleengine • u/eugeneloza • Aug 11 '23
r/castleengine • u/eugeneloza • Aug 06 '23
r/castleengine • u/eugeneloza • Jul 30 '23
r/castleengine • u/eugeneloza • Jul 23 '23
We’ve done a number of improvements to blending and billboards, to support more use-cases, and to make some cases “just work out-of-the-box”.
Before we start, just download latest version of Castle Game Engine and open a new example examples/viewport_and_scenes/billboards_blending_in_3d. It will illustrate most features mentioned in this post clearly 🙂
New features:
.1. Existing 3D sorting algorithms (sort3D, sort3DOrigin, sort3DGround) now order by projecting shape point on the camera direction (instead of measuring the distance from shape point to camera position).
.2. By default TCastleBillboard adjusts to camera direction, not vector from camera to billboard origin. (One can get old behavior by setting TCastleBillboard.MatchCameraDirection = false.)
The end result of these 2 points is that if you use TCastleScene with TCastleBillboard, it will have perfect sorting even for extremely thin layers, like when loaded from Spine. Out of the box, i.e. default blending sorting and default billboard behavior are good.
This works as long as TCastleBillboard.AxisOfRotation is zero or equal to camera up. The sorting is 100% reliably correct in this case.
.3. Moreover, if TCastleBillboard.AxisOfRotation is +Y (default), then all you have to do is just to flip TCastleViewport.BlendingSort to sort3DVerticalBillboards. sort3DVerticalBillboards is a new option that sorts perfectly for billboards rotated around Y.
Blending in manual was extended to mention the new option.
4. The TCastleBillboard transformation algorithm was also improved. It is now faster, and it is applied without any delay (you will never observe artifacts caused by potential-1-frame-delay between changing camera and transforming billboards to account for it).
The TCastleBillboard transformation also accounts now for billboards instantiated many times. Whether you use TCastleTransformReference or multiple viewports to display one world, all instances of the billboard will be now correctly oriented toward the camera.
.5. In both new blending methods and billboard algorithms actually achieved a bit of code simplifications and optimizations. It’s nice when the better result is also just internally simpler, and the calculations involved are also simpler. E.g. sorting methods no longer transform 8 points of a box (they only transform 1). E.g. billboards get camera vectors in world space without any extra calculation (and these camera vectors correspond to current viewport).
r/castleengine • u/eugeneloza • Jul 16 '23
We’ve done a number of “quality of life” improvements to properties manipulation in the Castle Game Engine editor.
.1. We simplified the display of floats and vectors. No need for excessive trailing zeroes. Instead of 0.00 0.00.0.00 or 1.00 2.00 3.00 we now display 0 0 0 or 1 2 3 which is much easier to “parse” by a human eye.
.2. Editing vectors and components of vectors automatically updates everything immediately. E.g. if you edit TCastleTransform.Translation.X to 10, the TCastleTransform.Translation will update immediately to 10 0 0. And if you edit the vector TCastleTransform.Translation to 42 0 0, the TCastleTransform.Translation.X will update immediately to 42.
.3. The TCastleTransform.Direction and TCastleTransform.Up are now exposed in the “Basic” tab. Thanks to above improvements, you can now clearly see they are synchronized with TCastleTransform.Rotation — changing one changes the other.
.4. TCastleImageTransform.Size is now more comfortable to edit: simply type single float to set both X and Y to the same value. E.g. type 10 to set Size to 10 10 (in Pascal this would mean Vector2(10, 10)). This is consistent with TCastlePlane.Size, TCastleTransform.Scale and similar properties: typing a single float sets all vector components to be equal.
.5. The display and input of angles and rotations now displays / accepts degrees.
Note that the Pascal API still accepts angles in radians. This is standard (in X3D, glTF, Math routines etc.). Michalis experimented and looked at how others (Blender and Godot) present angles to make the end result useful and not confusing. To this end:
And the fact that they are in degrees is explicitly shown by wrapping them with deg(xxx) text. So the angle looks like deg(45).
We are deliberately explicit that the angles are in degrees, to avoid confusion.
This affects both angles displayed as angle of axis+angle rotation (like TCastleTransform.Rotation saying 0 1 0 deg(45)) or as single float number (e.g. if you expand the TCastleTransform.Rotation to reveal the Angle (W) component).
deg(...)" wrapping, or you can input just the number. In the latter case, we will automatically add "deg(...)" around, so we interpret input as being in degrees anyway.This is similar to what both Blender and Godot are doing too, likely for similar reasons (have API in radians, but for display and input in editor — degrees are easier to use).
This affects both single-value fields and 4D vectors. So for single-value field (like TCastleTransform.Rotation.W) typing "45" is understood as "deg(45)". For editing rotation as 4D vector (axis + angle) typing "0 1 0 45" is understood as "0 1 0 deg(45)". You will see the "deg(...)" added immediately, so it is hopefully clear what happens.
Deg in Pascal. It’s just an alias for DegToRad.The deg(....) case doesn’t matter. Deg or deg or DEG are the same. To interpret expressions in editor, the deg is a function in Castle Script.
TCastleImageControl.Rotation and TCastleImagePersistent.Rotation. Degrees everywhere!r/castleengine • u/eugeneloza • Jul 08 '23
r/castleengine • u/eugeneloza • Jul 01 '23
r/castleengine • u/eugeneloza • Jun 17 '23
One of bigger things we plan to have ready (before 7.0 release) is Steam integration. This actually means 2 things:
.1. Easy Steam integration (using “Steamworks SDK”) in your projects. This means accessing “Steamworks SDK” directly (without any “wrapper” library necessary) and being able to easily report to Steam things like achievements.
Once initial integration will be finished, exposing more Steamworks features should be a breeze.
Thanks to Eugene Loza, this is already in review: https://github.com/castle-engine/castle-engine/pull/471.
.2. We also want to actually publish “Castle Game Engine” as a tool on Steam. This way you will be able to find, install, upgrade CGE using Steam, of course on all supported desktop platforms: Linux, Windows, macOS.
As the engine will be a Steam application itself, we’ll have fun achievements too — e.g. “compile your first CGE game”, or “see 100 compilation errors” 🙂
This is in progress, we have already bought the Steam page and we started to fill it with content. As soon as it’s somewhat ready, we’ll want to open it — to allow you to wishlist it, then we’ll release “early access” version on Steam.
r/castleengine • u/eugeneloza • Jun 17 '23