Replies: 36 comments 135 replies
-
There's a dotnet v6 branch in the Godot repo which is actively being worked on afaik |
Beta Was this translation helpful? Give feedback.
-
Please, create issues for these individual problems. If they already exist, add links to them so that I know what are those issues that are bothering you. Otherwise, there's little I can take from this. Regarding outdated dotnet, Godot 4.0 will switch to .NET 6. |
Beta Was this translation helpful? Give feedback.
-
One concrete thing I would like to bring-up here as well is the conversion of script languages into full-blown GDExtension modules. We already have 2 proposals where the discussion is ongoing: #3369, #3927 and @touilleMan from Godot-Python fame seems to like the approach as well. What do you think @neikeq: Would you support a similar solution for C#? I see a lot of benefits, and I would be happy to provide more details, if you are interested. |
Beta Was this translation helpful? Give feedback.
-
Another topic regarding C# is support integration within the scripting workspace. |
Beta Was this translation helpful? Give feedback.
-
According to Godot community poll in 2021, there are around 13% of people that use C# in Godot: As far as I know, the only reason why Godot got C# support is because of Microsoft's grant (and of course neikeq enthusiasm 🙂). Talking about myself: it's quite difficult to maintain C# support even for modules, that's why I don't provide C# builds for Goost, for instance, because I'd rather focus on feature development rather than fighting against the buildsystem, issues like godotengine/build-containers#95 slow down the development pace. So, I guess it's a matter of allocating enough of funds for C# support to thrive, to be honest. But then think about other major issues or lack of features in Godot (like lack of GLES renderer in Godot 4.0). |
Beta Was this translation helpful? Give feedback.
-
I'm using c# with Godot for 2 years . Technically I think C# side is very stable on Godot right now. @neikeq has done a good job. The problem is starting documantation side. C # users rate is 13% because documentation support is bad. Even very simple features are not available in the C # code samples in Godot Documentation. If you do not constantly strive or your intuition is bad, you cannot use Godot with C #. This is actually a sad situation. Because a labor is wasted on the C # side and people can't use it. |
Beta Was this translation helpful? Give feedback.
-
Someone at Godot Reddit has already being using Godot 4 mono for a few weeks with a smiling face. I compiled a few weeks back, it is less stable but usable. However, from the progress of porting to .NET 6, I look forwards for the .NET 6 branch merging to the main branch BEFORE Godot 4 becomes beta (as stated recently) |
Beta Was this translation helpful? Give feedback.
-
The best way i'v found so far to work with Godot and C# is to use C# scripts for the root node of your scenes and then GDScript for all subsequent scenes. That way you can have C# as your main language (and you can use a DI container properly) and use GDScript with modules/components. C# is great and in my case necessary but GDScript is also very integrated and provides alot of syntaxic sugar that makes things easier. Other than that i also think its quiet stable at this point (credits to @neikeq !). Looking forward to .NET 6 support💪. |
Beta Was this translation helpful? Give feedback.
-
Been using C# for a couple of years exclusively in Godot, the only gdscript in my project is in (third party) addons (I have my own addon for the project tooling, but even that is in C#). Generally speaking I find support excellent. I use Rider IDE and can debug and profile code no problem, and autocomplete/intellisense works perfectly and often saves me from having to look up the docs. The recent RC2 build for 3.4.3 fixed mono tool scripts losing their values on reload, that was a big issue but works fine in that version which should be out in stable soon. As long as I set the editor settings build tool to dotnet CLI rather than msbuild, everything works great for me; I can even bump the language version in the csproj file up to 10 (the default is 7, I think?) and use most modern features without issue, and I only have dotnet sdk 6 installed on my system, so things work fine but I guess there are a few very new features that aren't supported (I wouldn't be able to name them though, I haven't yet found something that didn't work for me). Outstanding issues that I do have:
I can't think of anything else really and all of those can be dealt with and I think are known issues. C# in Godot for me is amazingly productive and very rarely do I encounter anything where the combination of API docs for GDScript and IDE autocomplete can't help me to figure something out. There's also a 3.4 C# API reference here from paulloz: https://paulloz.github.io/godot-csharp-api/ which is helpful Edit: and not to distastefully dunk on Unity, but given Unity is a C#-first engine, I actually find working with C# in Godot much less restrictive. With Unity it feels like you're using "unity C#" and are constrained by their design choices; with Godot it feels like I'm just using plain C# and interacting with the API and type hierarchy like any other application. |
Beta Was this translation helpful? Give feedback.
-
Most people using Godot will make toy projects. That is the same for all other engines and developer tools as a whole. C# is crucial in serious projects, at least in 3D which is where I spend most of my time. Having first-class support for it (both in terms of tutorials in the documentation as well as in the engine) will go a long way towards making better-performing games for developers making serious projects. |
Beta Was this translation helpful? Give feedback.
-
I personally would like to see more c# love and polish cuz that would bring more a lot unity people to godot |
Beta Was this translation helpful? Give feedback.
-
😂 this man thinks he's a god who decides everything |
Beta Was this translation helpful? Give feedback.
-
It would be nice if non-tool godot-inherited c# types were available to the editor regardless of the [Tool] attribute. So that editor scripts can properly deal with resources and nodes (make type checking work correctly). So the [Tool] attribute merely enables the godot callbacks. Similar to how it works in unity. |
Beta Was this translation helpful? Give feedback.
-
If Godot doesn't support C#, no company will probably use it. It would only stay with individual developers and very small teams. This is not conducive to Godot's development. Although Godot is becoming more and more popular, there is not a very good work to prove the engine. |
Beta Was this translation helpful? Give feedback.
-
godot4 c# is slower than godot 3 c#, will it be optimized in the future? |
Beta Was this translation helpful? Give feedback.
-
please implement this.. https://github.com/TheKetrab/godot-csharp-intellisense |
Beta Was this translation helpful? Give feedback.
-
I just wanted to commend the Godot community / maintainers of the C# integration. Working with C# in the Godot 4 beta feels first-class. We have implemented a custom binary network serialization protocol (which makes heavy use of generics magic) as a shared C# library and have no issues whatsoever. The classic gotchas of storing Godot related properties in a local variable to avoid (expensive) interop when e.g. doing a for loop are obvious if you're coming from Unity and a non-issue (personally speaking), documentation of this gotcha would help though. I can't give enough props for how good the engine feels in C# as we were especially looking for a strongly typed language to build our game. NativeAOT will be awesome in the future as well. Is there any way an individual could contribute to Godot, specifically in regards to the C# integration? How would one go about this? |
Beta Was this translation helpful? Give feedback.
-
I am using GDScript not because GDScript is great, but because it rarely makes mistakes, because the engine support is good, but I feel that the official support for C# is relatively cold, and it looks like a stepmother's daughter. |
Beta Was this translation helpful? Give feedback.
-
So... After giving Godot 4 Beta 7's Mono build a whirl, I'm having trouble seeing what people are talking about with C# being a second class citizen. I'm getting a feeling this is more of an appearances, documentation and tutorialization issue than anything. Most of the examples are in GDScript, and if you're even a journeyman in your programming career, it's pretty trivial to translate them to C#. But for lots of users, especially the indie dev audience Godot attracts, Godot is their first introduction to programming. Hence the strong bias towards GDScript in user share. It's Pythonic, dynamically typed, has no build step, and lots of examples and tutorials. I feel like this is reinforced by all the negative comments that just kinda say "C# is bad in Godot" without backing it up. I'd love to see a bullet point list of problems. I'll be using C# for my upcoming projects. The allure of stronger typing, a more mature language, and leveraging the .NET ecosystem far outweighs any minor ragged edges. I can't just import a library for dual countouring or utility AI in GDScript like I can in C#. |
Beta Was this translation helpful? Give feedback.
-
VS2022 for Godot4 .NET6 is working. However, we need to keep improving the experience Ideally, we need a hybrid test-driven environment that could test how GDscript and c# interoperability @MikeSchulze |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Yeah I should have mentioned that it's being worked on. That is definitely a valid point and I applaud the work on bringing C# Android back to Godot.
What specific needs do game engines have that make them so unique as to require their own language? I can see why shaders need their own language since they have a different hardware architecture, but a game engine is just connecting the game dev's scripting code to the underlying input, graphics and sound hardware and there's no way a small independent team is going to beat decades of work by multi-million or even billion dollar companies in the area of language design or language optimization. I do not mean any offense at all to the Godot team but it seems like they should focus on where they can bring the most benefit to the world and that isn't going to be in building a better language.
Such as? I am not meaning to be sarcastic here. |
Beta Was this translation helpful? Give feedback.
-
One can use GDScript immediately to access GDExtension and NOT c# NOW ==> this is an unfortunate lower priorty!. |
Beta Was this translation helpful? Give feedback.
-
We have to be VERY careful with this sort of this discussion which suggest lower priority of c#. |
Beta Was this translation helpful? Give feedback.
-
I think you can use vs2022 to write games out of thin air. Yes, there is no need to use godot. It is redundant, you only need a compiler. After compilation, it is AOT, which can convert the code to binary. It is faster and does not require completely immature support through godot. It is not necessary, early games did not require an engine, and now it is not actually needed. You need to be familiar with D3D12 instead of godot. |
Beta Was this translation helpful? Give feedback.
-
I just want to put this comment in here for anyone who is thinking about using Godot 4 + C# or thinking about switching from GDScript to C#, and then sees this 130 reply thread and gets cold feet- C# is more than usable as of November 2023. Don't be too discouraged. Still think about your decision, but there's a lot of out-of-date information in this thread. There are definitely places where it is missing features compared to GDScript:
But those features are nice-to-have (don't get me wrong, some are really nice to have, but still not critical), or corner-case bugs. And nobody ever seems to mention the things GDScript is missing which C# has:
C# used to have major issues, like really poor compiler messages and error messages, no helpful documentation, etc., but those have all been fixed. A lot of people complain about C#'s lack of documentation, but I would argue for the target audience (people who aren't completely new to game development or who are non-programmers), that's fine. I've been finding that my text editor's linting, hints and goto-definition have been more than sufficient documentation. There would be definite value in improving the availability of C# code snippets in the official documentation, given the recent Unity mass exodus, but it's not like there is no documentation- The C# doc pages are comprehensive and mention all of the caveats and differences to the GDScript API. Other than these clearly documented caveats, the C# API is almost identical to the GDScript API, in a really impressive way. Some people will disagree with me, I would argue that they are purists overly obsessed with perfection. GDScript is a tool that just works. C# is also, as of November 2023, a tool that just works. Both have their problems. Each is suited for a different kind of developer; GDScript is best for new users and non-career programmers, while C# is best for those with prior C#/.NET experience and generally those who are more focused on programming and the features one would expect out of a modern language. Hell, if it would help the community, I will gladly make a flowchart for the docs to help new users decide between the many different languages Godot supports. This is no longer a complicated decision. There is more to discuss, but that's the case with GDScript too. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this is Godot, or a fundamental behaviour of .NET hot reload. Either way, yeah, it is a pain sometimes. Mind you, when writing gdscript plugins I seem to run into similar issues with lost/reset state, so it may be more fundamental than just C# types/build system.
Resources have a built in Changed signal which you have to manually emit when you deem necessary - you can then subscribe to this elsewhere. If that's what you were doing already, perhaps you experienced the bug when assigning signal callbacks with the += event syntax which has been hanging around recent versions - its better to use the more verbose method of calling .Connect and constructing a Callable with Callable.From at the moment until that's fixed.
It would be nice if Godot exposed the PackedIntArray etc types in the GodotSharp namespace as they serve that purpose internally/in gdscript. Other areas of the API that expect a Packed Array type do accept C# native arrays, so it's a shame that functionality is missed in exported properties (unless there's some way I'm unaware of)
Unsure, but there may be a compiler event on the .NET side to indicate hot reload has occurred. Definitely could do with that being exposed in Godot if so, it'd be useful. |
Beta Was this translation helpful? Give feedback.
-
Throwing one more largely-anecdotal comment on the pile here. Small-time one-person dev for context. TL;DR: using Godot ~4 years w/ GDScript only, started using C#, opinion of engine improves enormously, still in love after honeymoon period. I've been using Godot heavily since 2020 and have struggled to make more than a few stray tech demos and half-finished jam ideas, primarily all 3D stuff. Every single project I've started to date usually ends up in a half-finished, unplayable state, and the major reason I'd pin it on is that I was writing the entire thing in GDScript. It's an excellent scripting language, incredibly impressive and ambitious for an open-source project, but very much not what I'd want to scaffolding a large, complicated codebase. It has some great features but the ones it's missing (no protocol/trait/interfaces, lack of a large dependency ecosystem like NPM or Maven, no type safety for signals, just to name a few) make it unsuitable for my needs. I was completely new to C#, but this year I've started a new project with a mix of mostly C# and a small amount of supporting GDScript, and I've absolutely loved it so far. I've had significant experience with a laundry list of popular languages and I've never used one with the amenities of C#. Just a couple weeks ago I hacked together an emulation of Unity's MonoBehaviour/GetComponent paradigm for Godot using generics and attributes, and it works amazingly. The pain points of Godot's C# integration are significant but, in my opinion, absolutely worth pushing through. Based on my needs and wants, using C++ for native extensions would be the most obvious fallback, but SCons builds significantly slower than dotnet and, hot take, C++ has a very hostile experience compared to C#. The godot-rust people are doing extremely fine work and I'm enthusiastic about it, but it's far from production-ready. I've never felt so confident about any of my projects until I started using Godot's C# integration. If it were to go away in future major Godot versions or transition into a non-officially supported GDExtension, I would find a way to keep using it. In any case I would never, ever, ever attempt to scaffold an entire project around GDScript again, so I would implore the powers that be to retain official C# support. I've always said I wouldn't consider using any other engine than Godot for its extremely good suite of existing features, and C# just made me dig my heels in another 10 feet or so. |
Beta Was this translation helpful? Give feedback.
-
C# implementation always lacks features and feasts on bugs. Scripted materials, resetting node stats when using nested tool scripts, buggy collections, cut out export properties, outdated dotnet. C# deserves more attention!
Beta Was this translation helpful? Give feedback.
All reactions