godot-python icon indicating copy to clipboard operation
godot-python copied to clipboard

godot 4.x?

Open sHaggYcaT opened this issue 3 years ago β€’ 16 comments

Is it any chance, that this project will support godot 4.x in the near future? Especially things, related to vulcan, etc.

sHaggYcaT avatar Feb 14 '22 17:02 sHaggYcaT

Hi @sHaggYcaT !

The issue with Godot 4 is it will deprecate GDNative API on which Godot 4 is based. So new development are required to support Godot 4.

On top of that the new GDExtension (that replaces GDNative) doesn't currently support what is needed for Godot-Python (see https://github.com/godotengine/godot-proposals/issues/3927#issuecomment-1031241451)

So supporting Godot 4 is definitely something I want to do, but there is a lot of work for this ;-)

touilleMan avatar Feb 14 '22 17:02 touilleMan

For people following the subject: Godot 4 is moving toward implementing what is needed to support 3rd party languages with GDExtension:

https://twitter.com/reduzio/status/1501824759818039297?t=8Ocv8xpB77wVQ3GJ6jtyKQ&s=19 https://twitter.com/reduzio/status/1501887283989032960?s=21

touilleMan avatar Mar 14 '22 13:03 touilleMan

I see some work in the godot4 branch. Is it usable at the current stage?

captain0xff avatar Apr 22 '22 19:04 captain0xff

TL;dr: The godot4 branch is not usable yet

The long version is I got fed up with scons build system (it is a powerful build system but I spent a surprising long time to hack it when adding features) so I wanted get rid of it.

I spend the last weeks building a custom build system (see the "isengard" folder in the godot4 branch) inspired by the good parts of scons and the flask framework (the idea was to have kind of a pythonic make that can be used as a library in any python project)

This build system was ok for simple tasks, but writing multiplatform c compilation/link rule was really painful (given how dynamic the code must be to handle all the specificity of different platforms)

So I considered my experience went far enough for the moment, and migrate again the build system to meson (this time for good, I promise ! ^^)

Now the main dev is on the godot4-meson branch. I'm currently exploring how the godot-extension API works, so it is the very beginning but things can move fast given all the code that can be reuse from the previous version of Godot-Python ;-)

Le ven. 22 avr. 2022, 21:16, CAPTAIN1947 @.***> a Γ©crit :

I see some work in the godot4 branch. Is is usable at the current stage?

β€” Reply to this email directly, view it on GitHub https://github.com/touilleMan/godot-python/issues/324#issuecomment-1106789999, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYKHNLUSW6F4HPHSR7CJM3VGL3JNANCNFSM5OMBO5JQ . You are receiving this because you commented.Message ID: @.***>

touilleMan avatar Apr 23 '22 06:04 touilleMan

Why not try Meson?

Zireael07 avatar Apr 23 '22 07:04 Zireael07

Why not try Meson?

The Godot-Python project is a rather special C project:

  • there is only one .c file
  • a lot of generation occurs (.pyx get turns into .c, most .pyx gets generated by jinja templates)
  • there is no need for deb/rpm packaging, regular unix installation (i.e. copy .so into /usrc/etc/shared etc.) is also meaningless
  • there is need for custom steps (downloading the Godot binary for testing, fetching the Python prebuild distribution, generating a final Godot-Python distribution)

From this point of view the project has a small need for C compilation and a big need for advanced scripting. Hence SCons seemed like a good choice (as a matter of fact I didn't have much choice given Godot-Python started before GDNative was a thing so I had to provide Godot-Python as a module that had to be put into the Godot source code, hence SCons was a mandatory πŸ˜„ ).

Given I wanted to try new concept around make-like build system (in the sens "tool that allow you to chain together arbitrary steps", by opposition of compilation build system like meson or Cmake that are dedicated to a specific usecase), Godot-Python seems like a good real life project to see how usable my ideas were.

Meson is a very good project, and using it was my fallback plan in the eventuality my new shiny build system was not as great as expected πŸ˜„

touilleMan avatar Apr 23 '22 09:04 touilleMan

Hello, first of all great work y'all, any updates on the project?

KeVs404 avatar Jun 24 '22 13:06 KeVs404

@KeVs404 Yes things are progressing rather slowly currently, but IΒ plan to sprint on this during Europython (so around 12-18 July) I hope we will have some nice progress then ;-)

touilleMan avatar Jun 24 '22 15:06 touilleMan

very nice, keep it up!

KeVs404 avatar Jun 24 '22 18:06 KeVs404

Any updates on this?

captain0xff avatar Jan 08 '23 18:01 captain0xff

@CAPTAIN1947 I'm currently focusing on support Cython (as Python support itself requires Cython support). However I still have unmerged PR for Godot related to GDExtension, so it's kind of complex to work with a moving target, will be better once Godot 4.0 is released ^^

touilleMan avatar Jan 21 '23 16:01 touilleMan

Hi touilleMan, I'm hoping to use this before Godot4 is released in a very simple way: just to run some python code, no need for the advanced features - just any pathway to call python functions and get their returns. Is it close to be able to make that happen and if so, could I connect with you for help to get it building/working?

I would just need a way to call a python function (eg from a global singleton) and get it's result - and vice versa to call a godot function from python, and get it's result.

Thanks and best!

robotsunknown avatar Feb 11 '23 16:02 robotsunknown

Hey @touilleMan - I see you've now got godotengine/godot-proposals/issues/3927 merged - does that mean a GDextension godot-python is in the pipeline? I'm a DevOps engineer starting a project to visualise and interact with Kubernetes clusters in Godot, and this would make life VERY easy for me.

des1redState avatar Feb 14 '23 22:02 des1redState

@des1redState yes I'm working on Godot-Python 4 for quite some time now ^^ See the godot4-meson branch, but don't expect anything: it's a big mess for the moment as I spend plenty of time trying stuff and testing & polishing GDextendion itself ;-)

touilleMan avatar Feb 14 '23 23:02 touilleMan

@touilleMan Fantastic news, thank you for your dedication. As you know, Python support opens up entire worlds to Godot, literally. Please do post here once you have any news, I really don't want to miss it!

des1redState avatar Feb 14 '23 23:02 des1redState

Is it abandoned? :(

sHaggYcaT avatar Sep 28 '23 00:09 sHaggYcaT