Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Support Godot C# #53

Open
gabrielesilinic opened this issue Sep 23, 2023 · 4 comments
Open

[Proposal] Support Godot C# #53

gabrielesilinic opened this issue Sep 23, 2023 · 4 comments

Comments

@gabrielesilinic
Copy link

So, just saying, remember that Godot supports C# and you could make a wrapper that looks and works like Unity's API but instead makes calls to the underlining Godot C# API, this way you won't have to translate all the code but just the Monobehaviour stuff, all other classes and possible packages can be kept the same if they are not unity specific

you don't have to translate to a whole different language and risk to break language specific features

@bshikin
Copy link
Contributor

bshikin commented Sep 23, 2023

Couple notes:
1 - renamed to "[Proposal] Support Godot C#"
2 - question @gabrielesilinic -- I thought in Godot 4x you can't export C#-based code to iOS, have they fixed it?

@bshikin bshikin changed the title [Note/Idea] Remember that Godot supports C# [Proposal] Support Godot C# Sep 23, 2023
@gabrielesilinic
Copy link
Author

gabrielesilinic commented Sep 23, 2023

Couple notes: 1 - renamed to "[Proposal] Support Godot C#" 2 - question @gabrielesilinic -- I thought in Godot 4x you can't export C#-based code to iOS, have they fixed it?

Apparently, the issues open on Godot related to the fact that you can't export or compile properly an iOS app while not being on mac or if you misconfigure xCode, but from a purely technical standpoint C# should work everywhere thanks to the optional native AOT builds, in fact looks like it does, Godot has a guide for it, unfortunately i lack a mac to test the thing myself.

so... here there is a guide for doing so in the oncoming release: https://medium.com/@phillipdev/exporting-to-ios-using-godot-4-1-for-free-ed99b8f594b7
and here the various GitHub issues:

here the user describes its issue, and the latest comment suggests what I said
godotengine/godot#70883

this is confirmed by a user in this other issue who successfully managed to export the thing to iOS unlike OP
godotengine/godot#44577

in the end the actual issue seems to be that Godot has a troublesome experience of exporting stuff to iOS at all, on google you can get quite a few results about this kind of thing https://www.google.com/search?q=site%3Agithub.com+site%3Areddit%3Acom+godot+can%27t+export+to+iOS

But, over a ton of manual labor and maybe remaining locked into unity I would still choose having the option of porting a game even if did not have iOS support, you would still get all other platforms anyway, translating across languages is much worse, instead if you stay with C#, you can use a "light" compatibility library and get other things done with a search and replace kind of transpiler tool, also Microsoft has built Roslyn to be modular, if you wanted you could use their code analysis tools as parsers etc. to later replace pieces of code.

@christophercong
Copy link

@gabrielesilinic
Godot 4.x, specifically, is lacking .NET C# support for iOS, Android, and Web; the editor won't allow projects to export to those platforms (note: I've tried to and the Godot docs call this out). Android is on the way to gaining support, but it's unclear when the other platforms will gain support (see PR). Also, there is also work to be done for C# to be performant in Godot, see proposal discussion.

On the other hand, Mono C# with Godot 3.x will work. There's an argument to be made that C# with Godot is unstable unless you're willing to stay on Godot 3.x for the foreseeable future. But I'm not sure how compatible it will be if one decides to move their project to .NET C# on Godot 4.x.

@squallsama
Copy link

@gabrielesilinic Godot 4.x, specifically, is lacking .NET C# support for iOS, Android, and Web; the editor won't allow projects to export to those platforms (note: I've tried to and the Godot docs call this out). Android is on the way to gaining support, but it's unclear when the other platforms will gain support (see PR). Also, there is also work to be done for C# to be performant in Godot, see proposal discussion.

On the other hand, Mono C# with Godot 3.x will work. There's an argument to be made that C# with Godot is unstable unless you're willing to stay on Godot 3.x for the foreseeable future. But I'm not sure how compatible it will be if one decides to move their project to .NET C# on Godot 4.x.

It's fixed in 4.2 beta 1 - godotengine/godot#82729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants