Anyone using c#?

fire7sidefire7side Posts: 55Member
edited March 23 in Programming

I'm just wondering if I should convert this project to c# or stick with gd script. I'm in no rush, so time isn't important. What brought it up is I was looking for how to set up an interface in gd script and it turns out it's not supported. You have to check to see if the function or property is present every time it's called. I guess it's not that big a deal but it's more error prone. Then I checked for speed and found this page which says c# is about 10 times faster.
https://github.com/godotengine/godot/issues/36060
It sounds like it's getting more used all the time, but I heard it's not supported on phones and things. I was just going to do this project as a online game. I don't think speed will be that important because I use low poly. I suppose I should finish this project and then start the next one in c#. But then again, I would be more used to using it for the next project and I'm in no hurry.

Comments

  • cyberealitycybereality Posts: 651Member

    No, I haven't tried it yet. 10x speed boost sounds nice though, I may look into this later.

  • fire7sidefire7side Posts: 55Member

    Yeah, if you count that and that it's more robust, it seems like it would be worth it. I think I might just try to get it set up and see what I think. I programmed c# in unity for a bit before coming here. I don't think it would take that long to convert my project. It's still pretty small.
    I was also planning on maybe elaborating on this project for the next one so it's probably better to do it now.

  • TwistedTwiglegTwistedTwigleg Posts: 2,127Admin

    I haven't used C# that much in Godot, but the speed boost would help several of my projects. Not to mention, game logic and other code written in C# may be more easily transferable to Unity, and potentially other game engines since C# uses static typing.
    It is definitely something to play around with in the future!

    I think there is C# support for Android and WebGL now, though last I remember reading, iOS still is not supported. Though, it's been awhile since I've checked, so maybe things have changed.

  • fire7sidefire7side Posts: 55Member

    Thanks everyone. It's not even in beta yet, I guess, but since it's just a hobby of mine, I'm going to try using it anyway. I got it downloaded and hooked up to visual studio. Haven't really tested it yet.

  • KequcKequc Posts: 88Member

    I tried using c# around 3.0 or 3.1, from what I understand there has been progress since then. At the time it felt a lot like I was fighting against the engine and doing something I shouldn't do. GDscript is really convenient and built in to the editor. I'm not sure about general scripting being 10 times slower, I think there have been a few counter claims to that.

    But just for ease of use I decided to go with GDscript. I'd be interested to hear about your experience.

  • fire7sidefire7side Posts: 55Member
    edited March 27

    @Kequc said:
    I tried using c# around 3.0 or 3.1, from what I understand there has been progress since then. At the time it felt a lot like I was fighting against the engine and doing something I shouldn't do. GDscript is really convenient and built in to the editor. I'm not sure about general scripting being 10 times slower, I think there have been a few counter claims to that.

    But just for ease of use I decided to go with GDscript. I'd be interested to hear about your experience.

    I wouldn't call it fighting the engine, but there is a problem that if you delete something in Godot, you have to also delete it in the solution manually, I guess. I haven't gotten that far yet. They say up front it's not production ready. I think they are hoping to put out a beta version with the next release of Godot. I just got a small program to work in it so far. I'm in the process of seeing if I can convert this dungeon crawler I'm working on to c#. The speed difference would mostly be in compute heavy algorithms. Otherwise you are mostly just calling c++ functions and wouldn't notice it much.

    I'm undecided if I should switch. It can only do desktop apps right now. It appears to work all right. It would definitely be better to wait I think. I thought it was further along than it is.

    I'll probably end up figuring out an alternative to an interface because it doesn't seem like it would be worth the conversion at this time.

  • CalinouCalinou Posts: 353Admin Godot Developer

    Renaming scripts in the FileSystem dock should now update the .csproj file as this pull request was recently merged. It'll be available in Godot 3.2.2 and 4.0.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file