Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Godot Engine as a shared library #4773

Closed
fire opened this issue Jun 28, 2022 · 10 comments
Closed

Build Godot Engine as a shared library #4773

fire opened this issue Jun 28, 2022 · 10 comments

Comments

@fire
Copy link
Member

fire commented Jun 28, 2022

Describe the project you are working on

Multiplayer Video game - https://github.com/V-Sekai

Describe the problem or limitation you are having in your project

  1. I want to have dynamic mesh plugins and Houdini and Houdini like effects from OpenMeshEffect.

  2. @punto- Mentioned wanted to use Godot Engine from nodejs.

  3. I want to call libgodot from elixir.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The standard architecture of Godot Engine is that we want things to be Godot Engine Extensions.

It should be possible to embed Godot Engine into a shared library for OpenMeshEffect standard and also as an Extension.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Build Godot Engine as a shared library.

Replace the entry points of main.

See pull request.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No! This is a buildsystem change to Godot Engine.

Is there a reason why this should be core and not an add-on in the asset library?

Changing the build system of Godot Engine is difficult to most people.

@ghost
Copy link

ghost commented Jul 2, 2022

I am probably missing something, but why would there be a need for a library version of Godot? Looking at the resulting implementation it essentially provides same functionality as if it was running as a standalone version.

@fire
Copy link
Member Author

fire commented Jul 2, 2022

It exposes all the functions from godot engine on Linux.

So I can run:

Setup

  1. Main::setup
  2. Main::start()
  3. os.run()

Each tick

  1. iterate()
  2. call any exposed method symbol

@ghost
Copy link

ghost commented Jul 3, 2022

I get that, and that is what's bugging me about this. If this simply exposes main engine loop to be called manually from the outside code, why would you need something like this? This is not a critique in any way, I simply dont understand a practical application of running an engine that enforces its way or running processing code, event dispatch/poll, function call order e.t.c., e.t.c, e.t.c., as an external lib.

@fire
Copy link
Member Author

fire commented Jul 3, 2022

Language integration

  1. This is an alternative way to implement C# integration. Not my focus though.

Calling as a process

  1. OpenMeshEffect plugins are single shared library named .ofx
  2. Usable from nodejs as a direct c code integration.
  3. Call libgodot from elixir

For example I want to call a process to resize a mesh and output a gltf as a batch job.

@Lucrecious
Copy link

Lucrecious commented Jul 3, 2022

I am interested in this as well for a separate reason.

I'm pretty ignorant on Godot's rendering pipeline and rendering in general, so what I'm talking about or proposing might not make any sense or might be impossible to do... but

I was thinking about Godot Engine as a static/dynamic library as a way of creating an agnostic 3D viewport renderer for embedding into applications. In Godot, you can save the contents of a viewport to an image, or capture the results on a ViewportTexture...

If there was a fast way of getting the image data from the viewport without encoding it as an image, would it be possible to embed a Godot Viewport in another applications?

Dear ImGUI is agnostic in the sense that you can hook it up to any rendering and input system - is something like this possible in Godot? Like Godot handles all the rendering using OpenGL/Vulkan, but since it'd be a library then we can take the image/buffer data and display it somewhere?

@GeorgeS2019
Copy link

GeorgeS2019 commented Jul 7, 2022

form @techchol:

I want to use this in MAUI view so we can reuse as much backend code as possible on Multiplatform.
using the native UI as Menu (Both stylistic and UX reason).

Right now we kinda use frankenstein of BlazorWebView with Pixi.js as renderer then laying the Native menu on top.
If this is possible it would be way more efficient since we dont have to use WebGL and JSInterlop.

Hosting Godot in MAUI as feedback from this discussion

@ErivanDev
Copy link

I'm developing a prototype of an HTML multiplayer game that interacts with Colyseus.js on the client, on the server I want to use Godot as a Game Server running inside Node.js, so I removed the calls to WebGL (like the server version of Godot) and other things, and exported the template. I was thinking of opening a proposal for that, but maybe this proposal covers what I described. Am I right? Does this proposal cover that case?

@Calinou
Copy link
Member

Calinou commented Jul 8, 2022

on the server I want to use Godot as a Game Server running inside Node.js,

For Godot 3.x, this can be done by porting the server platform to be buildable for HTML5. This is a lot of work though.

For Godot 4.0, this can be done by running an HTML5 export template with the --headless command line argument (you'll need to modify engine.js or something to pass CLI arguments).

@fire
Copy link
Member Author

fire commented Feb 11, 2023

Superseded by #6267 The other proposal has an open pr

@Calinou
Copy link
Member

Calinou commented Feb 11, 2023

Closing per the above comment.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2023
@Calinou Calinou added archived topic:buildsystem and removed requires core feedback Feature needs feedback from core developers labels Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants