In progress: web target, IFC, mORMot sample

Posted on

Web target - initial logs
IFC example
mORMot and Castle Game Engine
mORMot and Castle Game Engine

This post contains a relatively unimpressive screenshot that actually shows a very important achievement 🙂

Things we are working on right now in Castle Game Engine:

  1. Web target.

    Yes, it means what you think 🙂 Just recompile any Castle Game Engine project to run in a modern WWW browser! No plugins of course, it’s using JS + WebAssembly, it just works.

    What we have: We have a CGE branch with build tool that can execute castle-engine compile --target=web and then castle-engine run --target=web to:

    • build a wrapper using Pas2js,

    • then build your game using FPC for WebAssembly,

    • generate skeleton HTML file with <canvas> element,

    • run a HTTP server (just compileserver from pas2js, on port 3000),

    • run a WWW browser to open http://localhost:3000/ and execute Pas2js-generated JavaScript that in turn runs the WebAssembly code.

    • The WebAssembly code initializes log (you will see typical CGE log messages in both the browser console and in HTML content), and then opens TCastleWindow with a special WebAssembly backend…

    • …and, nothing more yet 🙂 TODO: We fail at the moment we want to use glGetString. Next steps are known, we need to use WebGL from WebAssembly, and the way to do this seems to use TJSWebGL2RenderingContext from job_web. Stay tuned!

    More information (what we have, what we plan) on the dedicated web target docs.

  2. IFC (Industry Foundation Classes) format support.

    It’s “another 3D model format”, ISO standard, that we support. It defines useful concepts for architecture, construction and engineering use-cases. It cooperates with some known applications in the domain, like Revit, ArchiCAD, BonsaiBIM in Blender, FreeCAD and many others. It defines concepts useful for building real-world stuff — the things defined are not only displayed in 3D, they may also have plans, they may have costs, scheduling and other metadata useful for real people making it.

    It’s also quite special — we provide dedicated API for it, using IFC classes, to load (or build from scratch), save and modify IFC models.

    A lot of basics work already. The IFC models can be loaded, modified and saved. We have examples/ifc that shows this.

    TODO: We work on making it now “as complete as possible (though without CSG and NURBS)”.

  3. Collaborative editing of 3D world using Castle Game Engine and mORMot2.

    This is a new example using our engine and mORMot 2.

    It shows already how you can modify and render a 3D world using our engine, and send the world information to a server made usign mORMot 2. The server synchronizes world state to a database on disk.

    TODO: The missing feature is “collaborative editing” promised there. Right now actually changes from other users are not synchronized as I envisioned.

Have fun with Castle Game Engine! And if you like what we do — please support us!

Start the discussion at Castle Game Engine Forum