Digital Twin Creation Using the Castle Game Engine

Is it possible to develop a digital twin using the Castle Game Engine? As a Delphi Developer, I would rather use Object Pascal than go the route of Unity.

Unfortunately this is not the area I specialize in or even have any good understanding of. But if I understand correctly - it requires creation of a relatively accurate interactive 3D model of the object in question. Indeed, this kind of things can be done in Castle Game Engine. You’ll need to create a model in Blender and then attach some “interactions” to the model’s component found by-name in the “big” 3D model file. And of course it can interface with Delphi/Lazarus components for convenient workflow, displaying the model and allowing User to interact with it through TCastleControl.

However, as I don’t have experience of specifically this task, I don’t know how this solution will “Scale”. E.g. I understand how to do that with a “control panel with 3 buttons” but when the interactive components count will reach dozens to hundreds with different models requiring a wide variety of different interactions - it might get complicated. I do think there should be specialized software to handle this task out-of-the box, though I’m not aware of it.

Well, technically I think that one will need to create a “special layer” of interactions, not just attach interaction (as a Pascal procedure that will run on interaction) to a component by-name, but rather create a “scripting system” which will allow to attach additional metadata to model’s components and provide an “abstraction layer” (e.g. buttons can be pushed, switches can be toggled on and off, tumblers can change between a number of preset values, etc.) that will not require “writing a new program for every model” but will be able to operate the model on a more abstract level. Note, that sometimes “writing a new program” may be a preferred approach as it allows to work with the model on deeper level, unless the abstraction layer is something that already exists and is versatile enough. Again though, as I’m more a game developer I understand how to create a similar system for a computer game, but for specific task of making Digital Twins - requires “research” and “prototyping” to determine the best approach and how efficient it will be.

Finally, instead of attaching interactions runtime, you can attach “scripts” in CastleScript or PascalScript (I believe that support for more scripting languages, like Lua and JavaScript is planned in the future) to the model components. However, I don’t have experience of this and not sure of their capabilities and how to setup those properly.

1 Like