Replies: 2 comments 4 replies
-
There are already several proposals tracking this, such as #573 and #3367. Unfortunately, C++ development has always been like that (and will remain so for a long time). There is no turn-key solution to having a complete, up-to-date toolchain that works in any operating system. Any attempt so far usually remained scoped to a single operating system, or quickly ended up being outdated or too bloated. I recommend using GDScript (or C# if you need more performance) instead. Also, if you hit performance issues, there's a fair chance you may able to optimize your current code to avoid switching languages (which will always be a long and arduous task). |
Beta Was this translation helpful? Give feedback.
-
Both those proposals sound good. FYI, my use case is suggested for GD Extension in the documentation: https://docs.godotengine.org/en/stable/classes/class_audiostreamgenerator.html?highlight=AudioStreamGenerator |
Beta Was this translation helpful? Give feedback.
-
It kind of feels like GD Extension, like GD Native before it, exists for Godot developers rather than Godot users. Godot's pretty simple, and straight out of the box useable, even for kids. That's why I love Godot. But GDNative is... different. I think it could be better.
I'm a pretty novice programmer, but I did learn C++ in university. I'd love to be able to use it, (sparingly) for performance reasons, but I really don't understand the complex build toolchain needed to get it off the ground. I'm used to hitting "build" in my IDE. I understand that, if you're on Github, what's necessary will probably seem stupidly easy. People have told me, "just use SCons, it's simple," which, I'm sure it is if you program for a living, but if you're an artist, say, it's incredibly obtuse. It's like if you asked me how to paint realistically and I told you, "just do it like Vermeer," and if you asked how you do that, I said, "Just use a camera lucida, it's simple. Look it up."
Currently, getting GD Extension up and going requires:
I've seen people code for the first time in Godot, and actually build things--kid's who don't even understand how a file system works because all they know is swiping through programs on their iPhone. Godot is that straightforward, usually. There's a reason most people prefer to just download the Godot binary rather than building it themselves. Likewise, lot of people who could probably benefit from experimenting with compiled code are not going to be able to because the overhead of using GD-extension is far too demanding for the average user.
At a technical level, I can't make a concrete suggestion because, clearly, I really don't understand this stuff myself. Let me just describe how I wish GD Native worked:
I wish when I was in the FileSystem tab, I could right click, pick "new script," have "GD Native" right there under "Languages" and have it just work. I know GD Native is compiled, and not a script, but as a user, I just want to be able to write my cpp and header files in the editor, and have that code available in GD Script the same as I would any built-in object or function. I don't know what would be required to make that happen, but that's my ideal.
I understand what I ask is probably difficult, because it would require Godot to be able to compile the C++ code you write in the editor, and C++ compilers are huge. On the other hand, you need the Python-SCons-Compiler toolchain anyway if you want to use GD Native, so maybe you can ship separate binaries for those who want to use it, with the necessary tools embedded in the editor backend so they can do their thing without the user having to worry about the details. Or, if that's not practical, suppose that under the project tab of the editor's menu bar, there was an option to "enable GD Extension," and Godot could manage the dependencies and download SCons, and a compiler, and build the CPP project. From there, you, you could maybe just have a "build" button in the editor that has SCons build your C++ code for you.
Failing that, maybe just providing an installer, or something, anything with a gui, that can just get GD Extension set up, and send your code to built afterwards. I feel like I've been struggling at this forever.
Beta Was this translation helpful? Give feedback.
All reactions