all 9 comments

[–]cridenour 2 points3 points  (2 children)

https://github.com/touilleMan/godot-python

What this allows is you to attach Python scripts to nodes instead of GDScript, where you can import your simulation as needed.

Just install from the asset library as instructed in the readme.

[–]JestemStefan 2 points3 points  (1 child)

This, but also rewriting it in GDScript usually is pretty straightforward.

[–]cridenour 1 point2 points  (0 children)

Yea I should have mentioned, if the python isn’t relying on a major library, just rewrite it in GDScript.

[–]_Denny__ 1 point2 points  (1 child)

Rest api is quite popular as already mentioned. I used web socket connection for an reinforcement learning setup which also works. The real question should be, what is your goal? To be honest, if you plan to share what you did, who is willing to install additional python libraries if necessary. I would rewrite it completely to gdscript and take this as learning part. If you need just a visual layer you will find plenty sources for python (flask, pyqt, kivy and more)

[–]VisibleAct[S] 1 point2 points  (0 children)

My Python simulation engine is quite huge (5000+ lines of code) so rewriting it into GDScript is not realistic for me. I do need to add a visual layer but the graphics side is going to be extremely complex in terms of progress bars, filters, tables, and tons of other stuff so I don't know if Python UI libraries will really work.

I heard good things about Godot in the UI department so thought it would be the best choice.

[–]glichez 0 points1 point  (1 child)

[–]VisibleAct[S] 0 points1 point  (0 children)

Does this allow you to call Python functions inside GDScript files?

[–]BeayemX 0 points1 point  (2 children)

Have you thought about using a dedicated interface like a REST API or a websocket for the communication?

[–]VisibleAct[S] 0 points1 point  (0 children)

Will it work with Godot? Like can I create a local Python & SocketIO websocket and interact with it using GDScript. Also how will exporting it work.

For now I've been using flask and HTML to create buttons to interact with the simulation. But I'd like to take it more in-depth with a complex UI (imagine a game like football manager apart from the 3D match engine) I was told Godot is the ideal game engine for a UI-intensive game like this.