godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.99k stars 21.16k forks source link

Is it just me or is there something broken with NativeScript #14859

Closed Raj2032 closed 6 years ago

Raj2032 commented 6 years ago

I created a NativeScript like this (please click on the link to view the image).

After I created NativeScript, I get this error

Raj2032 commented 6 years ago

Hi @groud , I wanted to know was this a bug or something I did wrong? May I know did you add my issue to the 3.0 milestone?

groud commented 6 years ago

Well, if you did nothing more than adding the NativeScript and end-up with and error. Yes, this is a bug. If the problem is on master (please fill in the issue template correctly next time), yes, it should be on 3.0's milestone.

karroffel commented 6 years ago

I don't know where the error line comes from, but just creating a NativeScript resource itself isn't enough and not supposed to work, so I guess the bug here is the error reporting.

Raj2032 commented 6 years ago

Hi Gilles, may I know how do I exactly fill in the issue template correctly?

Hi Thomas, when I went to the scripts view (you know how there is 2D view and 3D view?), I see the error on the bottom left hand side of the editor.

What else do I need in order to get the NativeScript resource working then?

On Wed, Dec 20, 2017 at 9:25 PM, Thomas Herzog notifications@github.com wrote:

I don't know where the error line comes from, but just creating a NativeScript resource itself isn't enough and not supposed to work, so I guess the bug here is the error reporting.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353025058, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79BmIp3ObwO9tMX001K5QrqeFqVaogks5tCOCRgaJpZM4RIBSy .

groud commented 6 years ago

When you create an issue, you have this text:

Godot version: If thirdparty of self-compiled, specify the build date or commit hash. OS/device including version: If graphics related, specify also GPU model and drivers. Issue description: What happened, and what was expected. Steps to reproduce: Minimal reproduction project: Optional but greatly speeds up debugging. You can drag and drop a zip archive to upload it.

Please next time, fill-in the template, instead of removing it and write an incomplete message :)

What else do I need in order to get the NativeScript resource working then?

This is not the place to ask for help about how to use the engine, but for raising engine bugs/ask for features. If the raised error prevent you from using the NatvieScript, tell us. Else the only bug here is that it seems to produce an error message for nothing.

Raj2032 commented 6 years ago

Sorry mate I was not at all sure if it really was an issue, next time I will keep that in mind :) Is this error message preventing me from scripting, or am I still able to use it?

I understand that this place isn't for asking how to do something, but I have tried asking in forums but I am not getting a satisfied answer so I wanted to ask somebody who has more experience with this sort of stuff, may I know what else do I need to do before I can use NativeScript and use C++?

On Wed, Dec 20, 2017 at 9:50 PM, Gilles Roudiere notifications@github.com wrote:

When you create an issue, you have this text:

Godot version: If thirdparty of self-compiled, specify the build date or commit hash. OS/device including version: If graphics related, specify also GPU model and drivers. Issue description: What happened, and what was expected. Steps to reproduce: Minimal reproduction project: Optional but greatly speeds up debugging. You can drag and drop a zip archive to upload it.

Please next time, fill-in the template, instead of removing it and write an incomplete message :)

What else do I need in order to get the NativeScript resource working then?

This is not the place to ask for help about how to use the engine, but for raising engine bugs/ask for features. If the raised error prevent you from using the NatvieScript, tell us. Else the only bug here is that it seems to produce an error message for nothing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353030824, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79BsFZZV-EBwjWH2dQ1G6QbKzaC1Gvks5tCOZwgaJpZM4RIBSy .

karroffel commented 6 years ago

You can check this out, it's using C but it shows the basics.

groud commented 6 years ago

Read at least this : https://godotengine.org/article/dlscript-here But Godot 3.0 is not out yet, a lot of stuff still need to be documented. You can find a PR about that here: https://github.com/godotengine/godot-docs/pull/832

Understand that the Github issues are not here to support people using the engine. Just asking "How do I make NativeScript work ?" is too vague, and here is not the place to ask such question. However, if you think a tutorial is missing, you make a feature request it in the godot-docs repository (its not needed here, a PR is already written).

Is this error message preventing me from scripting, or am I still able to use it?

It's up to you to tell us that. But, yeah, it does not seem like a problematic error, you should be able to use a NativeScript anyway.

groud commented 6 years ago

Sorry I might sound a little bit direct, but we have already a lot of work on the engine, we don't have a lot of time to help the engine users in there ^^

Raj2032 commented 6 years ago

Why doesn't everything just come straight out of the box instead of making users manually do additional tasks just to use C++?

On Wed, Dec 20, 2017 at 10:24 PM, Gilles Roudiere notifications@github.com wrote:

Read at least this : https://godotengine.org/article/dlscript-here But Godot 3.0 is not out yet, a lot of stuff still need to be documented. You can find a PR about that here: godotengine/godot-docs#832 https://github.com/godotengine/godot-docs/pull/832

Understand that the Github issues are not here to support people using the engine. Just asking "How do I make NativeScript work ?" is too vague, and here is not the place to ask such question. However, if you think a tutorial is missing, you make a feature request it in the godot-docs repository (its not needed here, a PR is already written).

Is this error message preventing me from scripting, or am I still able to use it?

It's up to you to tell us that. But, yeah, it does not seem like a problematic error, you should be able to use a NativeScript anyway.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353038018, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79Bgy50kGXCFt03MiGKZhMIAmfu5yaks5tCO6CgaJpZM4RIBSy .

Raj2032 commented 6 years ago

I mean like why doesn't things just work straight out of the box? Should this be considered an issue?

On Wed, Dec 20, 2017 at 10:41 PM, Gilles Roudiere notifications@github.com wrote:

Sorry I might sound a little bit direct, but we have already a lot of work on the engine, we don't have a lot of time to help the engine users in there ^^

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353041391, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79BkqkQn3nMk7uFeocw4OqU4nI02enks5tCPJngaJpZM4RIBSy .

groud commented 6 years ago

See the comments in the other issue you opened. Setting up a C++ compilation environment is not Godot's purpose. This environment depends on the platform it's running on and thus should be set up by the user. You cannot have out-of-the-box C++ compilation.

Raj2032 commented 6 years ago

I am so confused, why is it with GDScript and for C#, users can directly create scripts in Godot and attach it to a game object, whereas we can't do this using C++ directly?

On Wed, Dec 20, 2017 at 10:59 PM, Gilles Roudiere notifications@github.com wrote:

See the comments in the other issue you opened. Setting up a C++ compilation environment is not Godot's purpose. This environment depends on the platform it's running on and thus should be set up by the user. You cannot have out-of-the-box C++ compilation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353044986, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79BgB3xA2XvZDvfYJeVRiW91j69LaCks5tCPaegaJpZM4RIBSy .

groud commented 6 years ago

Because C++ compiles to native code, while C# and GDscript compile to byte code. While native code is meant to run on a specific hardware, byte code is interpreted by virtual machine (which may run on different hardware).

Thus C++ is faster, but needs to be set-up depending on the environment. While GDscript and C# are slower, but can run over several platform provided it has the adequate virtual machine. GDscript's virtual machine is directly implemented within godot's code, while C#'s is basically Mono.

hpvb commented 6 years ago

I guess we could ship GCC with Godot in a separate download (like there is godot-mono, there could be a godot-c++). It'd be a bit of a pain in the ass though.

groud commented 6 years ago

To be honest, shipping Godot with mono seems already a pain to me...

Raj2032 commented 6 years ago

At least my suggestion is in the future builds of Godot, there should be an addon in the Godot repository that sets everything up for the user without having to go through complicated procedures.

On Wed, Dec 20, 2017 at 11:21 PM, Gilles Roudiere notifications@github.com wrote:

Because C++ compiles to native code, while C# and GDscript compile to byte code. While native code is meant to run on a specific hardware, byte code is interpreted by virtual machine (which may run on different hardware).

Thus C++ is faster, but needs to be set-up depending on the environment. While GDscript and C# are slower, but can run over several platform provided it has the adequate virtual machine. GDscript's virtual machine is directly implemented within godot's code, while C#'s is basically Mono.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353049222, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79Bphtm_5SqRw9tiNQ1vriioH2wgAPks5tCPvVgaJpZM4RIBSy .

Raj2032 commented 6 years ago

In Unity it gives the option to install seperate things such as a third party IDE, Android builds etc. I am sure Godot can do the same thing, Godot already gives the user the option to use either the mono version or no mono version, so why can't it do the same thing for C++ as well?

On Thu, Dec 21, 2017 at 10:38 AM, Joe Smith justman111111@gmail.com wrote:

At least my suggestion is in the future builds of Godot, there should be an addon in the Godot repository that sets everything up for the user without having to go through complicated procedures.

On Wed, Dec 20, 2017 at 11:21 PM, Gilles Roudiere < notifications@github.com> wrote:

Because C++ compiles to native code, while C# and GDscript compile to byte code. While native code is meant to run on a specific hardware, byte code is interpreted by virtual machine (which may run on different hardware).

Thus C++ is faster, but needs to be set-up depending on the environment. While GDscript and C# are slower, but can run over several platform provided it has the adequate virtual machine. GDscript's virtual machine is directly implemented within godot's code, while C#'s is basically Mono.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353049222, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79Bphtm_5SqRw9tiNQ1vriioH2wgAPks5tCPvVgaJpZM4RIBSy .

reduz commented 6 years ago

@Raj2032 C++ is not a simple language, and if you use it you are supposed to know what you are doing, or at least how to download a compiler.

If you are making a multi-platform game, you need to get plenty of toolchains and cross compilers that are several gigabytes big. bundling them is pointless. Even for a single OS you have plenty of choice for C++ compilers (MSVC, LLLVM, GCC). It's not only impossible for us to bundle them but also illegal.

I suggest if you are not familiar with this stuff, or don't intend to get more familiar with developing cross platform C++, to stay away from it.

Raj2032 commented 6 years ago

How is it illegal to bundel them together as one package?

Unreal Engine allows users to use C++ straight out of the box (please do correct me if I am wrong)?

On Thu, Dec 21, 2017 at 11:17 AM, Juan Linietsky notifications@github.com wrote:

@Raj2032 https://github.com/raj2032 C++ is not a simple language, and if you use it you are supposed to know what you are doing, or at least how to download a compiler.

If you are making a multi-platform game, you need to get plenty of toolchains and cross compilers that are several gigabytes big. bundling them is pointless. Even for a single OS you have plenty of choice for C++ compilers (MSVC, LLLVM, GCC). It's not only impossible for us to bundle them but also illegal.

I suggest if you are not familiar with this stuff, or don't intend to get more familiar with developing cross platform C++, to stay away from it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14859#issuecomment-353220695, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab79Bow-EDoO47KoZcxMX485ez0mH1glks5tCaOwgaJpZM4RIBSy .

vnen commented 6 years ago

Unreal Engine allows users to use C++ straight out of the box (please do correct me if I am wrong)?

You are wrong: Unreal asks the users to install Visual Studio (or another IDE): https://docs.unrealengine.com/latest/INT/Programming/Introduction/index.html

Also, Unreal engine is several gigabytes in size, while Godot is about 40 MB. And they ask you to download the C++ apart from that (Visual Studio is another huge package).

Seriously, if you want to use C++, which is not really an easy language, you should be able to install a compiler. Which is something you do only once.

How is it illegal to bundel them together as one package?

Their licenses don't allow us to bundle with Godot.


Maybe we should add a warning on the NativeScript creation so beginners don't make one by mistake.

karroffel commented 6 years ago

C++ is not a first class GDNative citizen, because there are none. NativeScript wraps libraries - that's what it does.

For tighter integration with a specific language PluginScript should be used.