ProjectUnifree / unifree

MIT License
1.43k stars 75 forks source link

[Proposal] Support Godot C# #53

Open gabrielesilinic opened 11 months ago

gabrielesilinic commented 11 months ago

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 commented 11 months ago

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?

gabrielesilinic commented 11 months ago

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 https://github.com/godotengine/godot/issues/70883

this is confirmed by a user in this other issue who successfully managed to export the thing to iOS unlike OP https://github.com/godotengine/godot/issues/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 commented 11 months ago

@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 commented 11 months ago

@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 - https://github.com/godotengine/godot/pull/82729