General Questions about CGE!

Hi All.

I am completely new to the CGE. Coming from Unity & HTML5 (also tried out Godot, a little bit). I invested some time in Unity. But in the end the Engine got too big & slow. Also the philosophy of that company dont match with my mindset.

Godot seems to be nice. I just dont like the GDscript syntax (like python). I know there are bindings with other languages. But if you need help and you want to use tutorials, most of them are in GDscript.

After some time i discovered CGE by searching on the internet for a new Game Engine. Because of CGE i also discovered “Lazarus IDE” and the language Pascal. Honestly i just heard about it, but never used it. So no experience. And i read less people use it, thus newer languages are more popular. Maybe i am wrong here, and pascal is widely used. After watching some Videos about Lazarus IDE it seems very capable. Especially it is cross-platform. So CGE is cross platform. And the performance of pascal seems to be inbetween C# and C++. I understand that it is a little bit faster than C#. Anyways, this was my small research. Please correct me or add some information to my current knowledge.

For me, it is important that the engine i use, produce a small footprint. For all platforms. Especially mobile & Web. And it is important for me, that the apps / games run on very low end devices (like 8+ years old mobile phones). I tested some games from CGE for example the paralax dragon side scrolling APK.This one is only 2-3mb big and runs “smooth” on my 8 years old mobile phone. I like this capability.

So i have some questions to users / main-devs:
a) is the webGL platform export ready ? (i read it was in the making since 2020 ?)
b) can i mix 3D objects inside my 2D side-scrolling game ?
c) are there any premade tweening code snippets / libraries i can use ? Or do i need to build tweening
capabilities inside CGE from the scratch ?
d) are there any plans to integrate some kind of Global-illumination to CGE ?
e) Lazarus IDE in combination with CGE ? Does it make sense to build the UI in Lazarus and the 3D
inside CGE & combine both? Or is it more clever to build both inside CGE ?
f) Do we have a node-based material editor in CGE ?
g) Would it be possible to build some kind of “visual node system for coding” for CGE ?

I hope the forum don’t get angry, because of so many questions from me :upside_down_face:. I just want to know how the development of CGE is planed, also for the future. And i like to read some user experiences about CGE.

I wish you all a great start into the week.


I new in programming and never used other engines, so, i can’t compare CGE with something else.
But it very close to my philosophy. Lightweigth, open and very crossplatform - it’s about CGE, Free Pascal and Lazarus, very nice trio for me.
About development - I work under game with 90% procedural generations, so, I usually work in Lazarus and run project from IDE Lazarus. I open CGE window very rare and can’t say about it to much.
Engine gave me effective instruments: I created 2D viewport for map and 3D viewport for environment scenes. Now i load insidee them what i need, from code. And it all work good together in one window.

I work at Thinkpad X240 without graphics card now - nothing problems with that. Will see, what happend, when i add more items at 3D scene.

Pascal syntax very beatiful in compare with Python, at my opinion. Now I must to learn programming more at Python and R, but i don’t like to do it after Pascal :expressionless:

Hi Noscow.

Thanks for sharing your experience and your thoughts.

I am also surprised about the “Trio”. Or the Duo with the Lazarus IDE. And i am super new to it. So i need to collect some experience with CGE and Lazarus IDE. And with the language Pascal. For what i see, the Syntax of Pascal appeal already to me.

Soon i would like to start with simple game-projects in 2D & 3D. And lets see what comes out.

What kind of project you are working on, with 90% procedural level generation ? Maybe you can show something. Do you have also some experience with mobile publishing ?

I want to make RPG / Quest.
World is divided into zones, it like regions in TBS. Every zone will have 3D screen, where player can look around like in Google map panoramic photo (it is like background in classic quest or town screen in HOMM, but 3D). In this 3D environment player will interact with objects and characters in point-and-click style - it’s quest-like gameplay part, because camera can rotate, but not move on location (i hope it make illusion of big locations).
And playable character, his abilities and characteristics - it will be RPG part.
Regions and objects must generated different: world and locations - it’s like grids with randomize objects.
But I work slowly and sometimes my plans exceed my abilities . Now i want to finish some visual parts of game. When I will done visual part in minimal complectation, I share it code and data. But i don’t know, when… At the current stage code is to messy for present it to public.

I think, you can get good experience here. Do you have some project idea?

There are a few questions I can answer:

Yes. As in Unity, 2D is done by othographic projection. And like Unity you should be careful with the z-axis.

CGE community is small and the development team doesn’t have as much muscle as other so there are not much yet. By the way you can find stuff in the examples directory you can borrow.

No, it doesn’t (as far as I know). Lazarus UI designer is build for FCL components, not for Castle UI components. You must build your game UI with CGE’s editor.


Maybe in the future, but I actually don’t care. I’m not fan of “graphic languages” except for teaching programming basics.

1 Like

Ah okay. Sounds like a sophisticated project. I guess many things to do. Dont know if you do the content by yourself. What can speedup the process, is to buy some content (or get it for free). If you run out of time, or so. And when your code is clean, its a great idea to share some prototype parts of your game. For learning purposes. My first project, i would like to start with is very simple: a flappy bird clone. So i have some game mechanics to code and so i can learn and get the experience with CGE.

Thx for answering almost all questions.
For e) i thought i saw somewhere a integration of CGE inside the Lazarus IDE, with some kind of a window that present the 3D-content. Maybe i misunderstood it. c) Thats a good tip. Thx. As for g) It could be a good entry point for beginners in CGE. And it could speed up Prototyping. I remember when i used such tools inside Unity and the game gets more complex, the nodes did not help me so much anymore. So coding :heart: is the way.

CGE community is small and the development team doesn’t have as much muscle as other…

Yeah, i understand. Lets see what the future brings…

@sledge Hello and thanks for the good words about the engine!

Let me add some information on top of ready answers in this thread:

  • About Lazarus IDE: Note that you can use any text editor to write Pascal code, not necessarily Lazarus. E.g. you can also use VS Code ( Visual Studio Code | Manual | Castle Game Engine ). I’m not discouraging from using Lazarus, just saying you have options :), CGE is not strongly tied to Lazarus. I’m usually coding CGE using Emacs :slight_smile:

Not yet.

WebGL is going to be a focus during 2023, after 7.0 release. I consider it an important feature of CGE, because it’s very useful and very doable :slight_smile: (FPC has WebAssembly, we can render to OpenGLES 2.0 which is very much like WebGL 1.0 etc.) For now, we’re doing some tests with compiler, in particular @kagamma did tests of compiling CGE wtih FPC+WebAssembly, and Andrzej Kilijański will test it on GitHub - and3md/cge-fpc-internalerror: Searching for the smallest part of the engine on which we can reproduce internal error 200611031 soon.


I deliberately avoided any hard split between “2D” and “3D” in the engine. Typical 2D games use a different camera (orthographic, and locked to have view axis along Z) than 3D (perspective, free rotations) but these are just conventions. Inside, everything is 3D.

So you can place 3D objects inside a 2D world, you can do 3D camera tricks in 2D games etc.

E.g. our Escape from the Universe for Nintendo Switch - Nintendo Official Site was ostensibly a 2D game, but actually some objects are 3D and rotate around interesting axes for a better effect :slight_smile:

“Tweening” in general means key-frame animation, from what I know, and we surely have it. You can design your own animations of X3D nodes (things inside TCastleScene), the system is explained in Interpolation component | Castle Game Engine . But usually you should not need that page – of course we automatically animate stuff like key-frame animation in glTF, in X3D, or our sprite sheets.

If you ask for it in the context if UI animation – this is something we don’t have (yet). I want to add some ready components for UI animation, for now you just have to do it from code, updating any values you want in Update of some view ( Designing user interface and handling events (press, update) within the view | Manual | Castle Game Engine ) and change any value you need (like MyControl.Translation) using routines like Lerp or SmoothStep.

Eventually yes, but this is a big feature. First focus will be on new material components (before 7.0 release) and environment lighting ( Image Based Lighting (EnvironmentLight node) · michaliskambi/x3d-tests Wiki · GitHub ). We will get to GI solution at some point, but likely not in 2023 yet.

While you can build UI in Lazarus and then place TCastleControl inside a Lazarus form (see Engine on a form (VCL, FMX, LCL) using TCastleControl | Manual | Castle Game Engine )… for a new game, I would not advise that.

Instead: Design everything, including user interface, using CGE components in CGE editor.

Though it may depend on the use-case of course, so you have options :slight_smile: Basically there are 2 ways to use CGE:

  1. Use TCastleControl component, drop it on Lazarus form, following Engine on a form (VCL, FMX, LCL) using TCastleControl | Manual | Castle Game Engine . You can then surround engine rendering/processing in TCastleControl with normal Lazarus UI.

  2. Use TCastleWindow, that creates a window completely managed by CGE, and create all your UI using CGE in CGE editor. This is what our manual ( Manual | Manual | Castle Game Engine ) focuses on, this is more advised and fully cross-platform (e.g. our UI is scalable from start, it will work the same on Android / iOS), this is used by the majority of CGE examples.

No (not yet).

We have big plans to expose new material components soon: Roadmap | Manual | Castle Game Engine .

But note that this will not be a node-based material editing.

I want to also integrate CGE with MDL and/or MaterialX: Roadmap | Manual | Castle Game Engine . This will mean you can use some external tools to edit materials, also using nodes.

Time will tell whether we will add node-based material editor to CGE, or rely on some external tool for it from MDL / MaterialX space. It’s certainly something I’d like to have.

At some point probably yes – it’s an enticing feature and would rightly open CGE to a lot of more developers. But I don’t have immediate plans to attack this feature, definitely not in 2023 – it’s a big thing :slight_smile:

Sorry for answering with delay – I had vacation and was semi-offline for a week :slight_smile: Hope this helps, play around with the engine and don’t hesitate to ask more questions :slight_smile:

Hi Michalis.

Thanks a lot, for all the detailed answers !

The language compiles to a native language

Oh, didn’t know it can do this magic. Sounds really good. I will read a little bit more about Pascal, thanks to your Links.

I can´t tell you why, but i like small apps / programs. So i dislike big editors like Visual Studio (the raw install consume already min. 10gb, as i remember). The MS Studio Code is smaller. But still a bit heavy, in my opinion. If i do game projects, i would stick witch CGE or a small Editor. If i do some App Dev. I would stick to Lazarus IDE, i think. In the past i use always Notepad++. Its small-sized and you can use add-ons for it. I didn’t hear about Emacs Editor, until now. Sadly its not pre-compiled (ready to download and use). I am a Windows user, because many apps i need are: “Windows-Only” (like CAD software). Soon, i plan to get a Linux on my 2nd laptop. So i would like to test Linux native apps availability. And also windows-emulation like wine.

Happy to hear, that you and your team is working on WebGL. :slightly_smiling_face:

…because it’s very useful and very doable…

Most Game-Engines out there, produce quite big sized HTML output. Also not performant results. What i tried and used is: threeJS. This one is small and runs on many old devices (what i like, because you reach more users). And it is somehow very capable in terms of graphics-quality and performance. If CGE will reach this level it would be amazing. :+1:

I see it the same way. I would not seperate 2D from 3D like Godot. For me, because i like to have options and to mix 3D inside 2D.

…Inside, everything is 3D…

This is what i also got from somewhere. All graphics-cards are highly optimized for 3D. Therefore nowadays it makes sense to do the pseudo-2D job by a graphics card instead of a CPU. Btw, congrats for publishing “Escape from the Universe” on the Nintendo Switch ! I don’t have a switch, but from the Videos it looks butter-smooth and it has a nice style.

Okay. Hm, i think i got it. Inside CGE you can animate values by code (pos., color, etc) like shown here:

OrientationInterpolator {
  key [
    0, 0.5, 1,
  keyValue [
    0 1 0 0,
    0 1 0 3.14,
    0 1 0 6.28,

, but you don´t have a Timeline-Editor to set some key-frames for specific nodes in the hierarchy f.e. Outside CGE you can set up everything with your preferred 3D editor inclusive key-frames and save it to a format like: glTF & X3D. CGE imports the format inclusive these key-frames. Do i understand it correct ?

If so, a Timeline-Editor inside CGE would be a nice to have thing :+1:, also for UI. What i used for some of my HTML projects is “tweenJS” (CreateJS | A suite of JavaScript libraries and tools designed for working with HTML5). This way it super fast and easy to add tweening inside your code, like ease-in, ease-out, etc.

Just wanted to know if it could be implemented inside CGE at some point, or if its completely unrealistic to speak about a GI solution in a far future. I could help myself through baking GI into Materials. Its not real time, but it could accomplish already the needed style. The IBL & the new Material Components are bundled in some way, i guess. Is the IBL already part of CGE 7.0 ?

Okay. I will stick with suggested way 2. Especially because of:

…and fully cross-platform…

I like cross-platform. :slightly_smiling_face:

For example, i like the Blender Material solution. You can switch between node and a normal Material Editor system. I mean, i agree nodes can be confusing and could consume more time than a convetional method. Especially if it gets very complicated. I like the idea to use existing solutions like (MDL / MaterialX --i dont know these). Do they have their own material-editors ? Or would you like to integrate some kind of editor inside CGE for these external solutions ?

I like to hear, that you see such demands positive :slightly_smiling_face:.

…rightly open CGE to a lot of more developers

Shame on me … but this was really the case for me, when i got first contact with a game engine (unity). I am more a visual guy, a designer than a coder. My wish was to create some small games. So the entry point with unity was very easy for me. After some time it also motivated me to to start coding (C# & later JS for HTML). And i recognized that coding can also be fun (even i am not a pro and it would take more time than a pro), but also solving problems can be easier by code instead of nodes. In the end It depends. Just wanted to explain my thinking why it could a nice thing, in some future releases for non-coders, beginners.

Sorry for answering with delay – I had vacation and was semi-offline for a week…

I have to say sorry, because of too many questions :upside_down_face:. Enjoy your offline-time :sun_with_face:.
Soon i will play around with CGE. Before this, i am installing Lazarus IDE with some add-ons. This takes time. I want to play with both: Lazarus & CGE. Last questions: CodeTyphon. Is it the same like Lazarus? Or why i should stick with it or not with it. Maybe you can explain it. For me its a bit confusing, both are open source, i think.

No hurry. When you are back on track & when you are fully recharged, you can answer the questions :wink:

Yes, exactly.

We can import key-frame animation (e.g. from glTF or X3D) but we don’t have a way to create / edit the animation (of anything) in CGE editor. Yet :slight_smile:

IBL is not part of 7.0, and I will probably postpone it after 7.0 release (because making 7.0 release is already taking us a big time :slight_smile: ). It’s definitely something I want to do in 2023 though.

They have their own editors, e.g. MaterialX: MaterialX/ at main · AcademySoftwareFoundation/MaterialX · GitHub , MaterialX - ShaderGen and MaterialXView .

So at the beginning, CGE could just run some external tool (maybe distributed alongside CGE – that MaterialX editor is open-source and we could “bundle” it with CGE) when you double-click on MaterialX material. How much more it will become integrated with CGE then – future will tell :slight_smile:

We do not support Code Typhon ( Supported compilers and IDEs | Manual | Castle Game Engine ).

It’s a fork of FPC / Lazarus, and in the past they did a few things that made be loose the trust in them (not acknowledging prominently that the product they offer is in most part a repackaged version of FPC, Lazarus and some other projects; and not being transparent (no version control, no cooperation with the projects they include); and confusing “freeware” with “open-source” on their website).

It is admittedly a non-(precisely-)technical argument from my side. In the end, I decided to dedicate our support to:

  • FPC (and any IDE on top of it, like Lazarus) and

  • Delphi.


but we don’t have a way to create / edit the animation (of anything) in CGE editor. Yet :slight_smile:

Okay. Got it. :+1:

MaterialX bundle with CGE seems to be a good idea. Currently the MaterialX Graph Editor seems to be needed compiled with cmake to be used.

Code Typhon:
Thx for explanation. So we are save sticking with FPC + Lazarus IDE. (Delphi is a bit too expensive for me)